Mysql在90天内获取记录

时间:2018-06-05 00:38:03

标签: php mysql select date-range

我有一张桌子,我必须在接下来的90天内获得有certify_date的记录。我尝试了以下但它给了我最近90天的记录

SELECT id, username, firstname, lastname, recertificationdate
FROM mytbl 
WHERE certify_date BETWEEN DATE_SUB(NOW(), INTERVAL 90 DAY) AND NOW() 
ORDER by createdon DESC 

0 个答案:

没有答案