标签: 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