最佳答案:Sql中的时间函数TO_DAYS1.获取当天的数据:TO_DAYS(a.last_operation_date) = TO_DAYS(NOW())a.last_operation_date:数据库中存
Sql中的时间函数TO_DAYS
1.获取当天的数据:TO_DAYS(a.last_operation_date) = TO_DAYS(NOW())
a.last_operation_date:数据库中存时间的字段,now()表示当前的时间
TO_DAYS(now()) :返回从年份0开始到now()现在的一个天数
2.curdate():获取当前的年月日
curtime():获取当前的时分秒
now():获取当前的日期和时间