1.获取当天零点
select TIMESTAMP(CAST(SYSDATE() AS DATE));
2024-01-11 00:00:00
select TIMESTAMP(DATE_FORMAT(CURDATE(),'%Y-%m-%d %H:%i:%s'))
2024-01-11 00:00:00
2.获取前一天零点
select TIMESTAMP(CAST(SYSDATE()AS DATE)-INTERVAL 1 DAY) ;
2024-01-10 00:00:00
3.获取3分钟前的时间:
select TIMESTAMP(DATE_ADD(NOW(),INTERVAL -3 MINUTE));
2024-01-11 16:30:22