728x90
#날짜함수
현재 날짜와 시간, 일시를 다루는 함수의 경우 from 구문이 없이 사용 가능합니다.
| current_date | 현재 날짜 |
| current_time | 현재 시간 |
| current_timestamp | 현재 날짜와 시간 |
사용 예시
select current_date, current_time, current_timestamp;
결과

#extract
현재 날짜에서 년, 월, 일을 따로 추출하고 싶으면 extract구문을 사용하면 됩니다.
사용 예시
select current_date,
extract(year from current_date) as year,
extract(month from current_date) as month,
extract(day from current_date) as day;
결과

'파이썬으로 퀀트 프로그램 만들기 project > MySQL' 카테고리의 다른 글
| MySQL - case (0) | 2023.07.31 |
|---|---|
| MySQL - like 술어, 문자열 일치, between 술어, isnull, in 술어 (0) | 2023.07.31 |
| MySQL - error code: 1175, safe update 모드 해제 방법 (0) | 2023.07.27 |
| MySQL - 산술함수 (0) | 2023.07.27 |
| MySQL 기초 - 뷰 와 서브쿼리 (0) | 2023.07.19 |