1、查询今天的数据
SELECT * FROM exam WHERE to_days(create_time) = to_days(now());
2、查询昨天的数据
SELECT * FROM exam WHERE to_days(now()) - to_days(create_time) <= 1;
3、查询最近七天的数据
SELECT * FROM 表名 WHERE date_sub(now(), interval 7 day) <= date(create_time);