要查询最近三个月内注册的人~求高手帮忙啊~
解决方案
10
SELECT * FROM table_name
WHERE (DATE_SUB(CURDATE() – INTERVAL 3 MONTH ) <= my_date);
WHERE (DATE_SUB(CURDATE() – INTERVAL 3 MONTH ) <= my_date);
30
SELECT * FROM table where inputtime>DATE_SUB(CURDATE(), INTERVAL 1 WEEK) --一周 where inputtime>DATE_SUB(CURDATE(), INTERVAL 3 MONTH) --三月 where inputtime>DATE_SUB(CURDATE(), INTERVAL 1 YEAR) --一年