date_sub()函数:
DATE_SUB(date,INTERVAL expr type)
实例:
SELECT NOW(),DATE_SUB(NOW(),INTERVAL 1 HOUR) as the_time
select * from xxx where create_time > DATE_SUB(NOW(),INTERVAL 1 HOUR);
转自:https://www.cnblogs.com/vijayfly/p/6265871.html
date_sub()函数:
DATE_SUB(date,INTERVAL expr type)
实例:
SELECT NOW(),DATE_SUB(NOW(),INTERVAL 1 HOUR) as the_time
select * from xxx where create_time > DATE_SUB(NOW(),INTERVAL 1 HOUR);
转自:https://www.cnblogs.com/vijayfly/p/6265871.html