Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个 MySQL 列,它以 mm/dd/yy 格式保存到期日期。
如何获取从今天起 2 天内到期的记录?
尝试:
SELECT * FROM TABLE WHERE CAST(EXPIREDATE AS DATETIME) BETWEEN NOW() AND DATE_ADD(NOW(), INTERVAL 2 DAY);
http://www.roseindia.net/sql/sqldate/sql-date-add-days.shtml