* SYSDATE()
함수가 실행될 때의 시간을 리턴한다.
* NOW()
현재의 날짜와 시간을 리턴한다.
* 추가적인 설명
SYSDATE() :
트랜잭션이나 쿼리 단위에 관계 없이, 그 함수가 실행되는 시점의 시각을 리턴한다.
따라서 위의 예시를 보면, 실행한 시각을 출력하는 것을 볼 수 있다.
NOW() :
하나의 트랜잭션으로, now() 함수가 실행된 첫 시각을 리턴한다.
따라서 위의 예시를 보면, 실행한 첫 시각만을 출력하는 것을 볼 수 있다.
출처 - https://dev.mysql.com/doc/refman/8.0/en/date-and-time-functions.html
MySQL :: MySQL 8.0 Reference Manual :: 12.7 Date and Time Functions
12.7 Date and Time Functions This section describes the functions that can be used to manipulate temporal values. See Section 11.2, “Date and Time Data Types”, for a description of the range of values each date and time type has and the valid formats
dev.mysql.com
https://kikikimoong.tistory.com/entry/MySql-SYSDATE-NOW-%EC%B0%A8%EC%9D%B4%EC%A0%90
'CS > database' 카테고리의 다른 글
CHAR VS VARCHAR (0) | 2021.07.20 |
---|---|
MySQL 이모지(Emoji) 문자열 입력 (0) | 2021.05.18 |
Subquery (0) | 2021.04.07 |
Join (0) | 2021.04.06 |
JDBC Programming 개발 순서 (0) | 2021.03.12 |