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.
我有一列日期类型,另一列时间类型,我想选择现在之前的所有项目。我无法让它工作。像这样的东西:
SELECT * FROM table WHERE CONCAT(date_field,' ',time_field)<=NOW()
有任何想法吗?
使用 MySQL 的ADDTIME()功能:
ADDTIME()
SELECT * FROM mytable WHERE ADDTIME(date_field, time_field) <= NOW()