SQL CURDATE()函數
CURDATE()
返回當前日期的'YYYY-MM-DD'或'YYYYMMDD'格式的值,根據函數是否用在字符串或數字語境中。
mysql> SELECT CURDATE(); +---------------------------------------------------------+ | CURDATE() | +---------------------------------------------------------+ | 1997-12-15 | +---------------------------------------------------------+ 1 row in set (0.00 sec) mysql> SELECT CURDATE() + 0; +---------------------------------------------------------+ | CURDATE() + 0 | +---------------------------------------------------------+ | 19971215 | +---------------------------------------------------------+ 1 row in set (0.00 sec)