SELECT * FROM t_user WHERE TIME>DATE_SUB(CURDATE(), INTERVAL 1 WEEK) 一周 SELECT * FROM t_user WHERE TIME>DATE_SUB(CURDATE(), INTERVAL 3 MONTH) 3个月 SELECT * FROM t_user WHERE TIME>DATE_SUB(CURDATE(), INTERVAL 1 YEAR) 一年 SELECT * FROM t_user WHERE DATE_FORMAT(t_user.`date`,'%Y-%m') = DATE_FORMAT('2020-11-21','%Y-%m'); 以月为单位查询数据