Mysql 查询以当前时间往后的24小时内的数据
register_date >=(NOW() - interval 24 hour)
例如:
select * from sys_user
WHERE register_date >=(NOW() - interval 24 hour)
and identity = 5;
-- mysql查询3条离当前时间最近的记录
select * from course_live
ORDER BY ABS(NOW() - start_time) ASC
limit 3
-- 大于当前时间的
select * from course_live
ORDER BY ABS(NOW() > start_time) ASC
limit 3
-- 小于当前时间的
select * from course_live
ORDER BY ABS(NOW() < start_time) ASC
limit 3