小编imr*_*ran的帖子

检查MysQL中的日期是Upcoming还是Past

我在表中有两列

  • event_date(价值是2013年9月22日)
  • event_time(价值是晚上7:11)

现在我想写一个查询,该查询应返回在Future或Past中有时间和日期的行

我写了这样的东西

select * from events e 
where concat(e.event_date,' ',e.event_time) <= date_format(now(),'%m/%d/%Y  %g:%i %a')
Run Code Online (Sandbox Code Playgroud)

但它并没有起作用,它只是其中一个你永远不知道它们有什么问题的东西

提前致谢 !

mysql sql

8
推荐指数
2
解决办法
1万
查看次数

标签 统计

mysql ×1

sql ×1