1
我在表中有两列要合并,以便稍后检查值。MYSQL将日期和时间字段组合到数据时间值
第一列是open_date
(DATATYPE = DATE)
第二列是open_time
(DATATYPE = TIME)
我想的值结合起来,是这样的:2013年4月26日12时34分:57
然后我必须检查组合的日期时间是否早于今天。
这是我的查询:
SELECT * FROM blog_articles WHERE concat(open_date,' ',open_time) <= DATETIME()
但我得到的跟随着错误:
#1064 - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '() ORDER BY `open_date` DESC
LIMIT 0, 25' at line 1
@Rubentje,没有这个解决您的问题?你可以提供一些反馈吗? – trincot
是的!谢谢! – Rubentje
Graag gedaan! ;-) – trincot