我有一个列(expire_date(varchar))
,其值存储为2016-05-11 13:19:32。我想将此值与 NOW() 进行比较。我想选择 expiry_date 大于当前时间的行
我的代码:
select * from tbl_table where expiry_date > NOW()
但我不知道这是否正确。
最佳答案
试试这个:
select * from tbl_table where CAST(expiry_date AS DATETIME) > NOW()
关于mysql - 与 MySQL 中的 NOW() 比较日期,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35935112/