【问题标题】:Why is MySQL date between throwing an error?为什么MySQL的日期在抛出错误之间?
【发布时间】:2020-04-07 03:23:07
【问题描述】:

这个查询可以在 MySQL 中实现吗,我尝试了不同版本的 MySQL 但没有用,相同的查询在 postgresSQL 中有效。

select * 
  from BetweenDateDemo 
 where StartDate between >= '2014-8-12' and curdate();

【问题讨论】:

  • 我不相信这个查询在 postgres 中有效。或任何其他 DBMS。

标签: mysql date between


【解决方案1】:

正确的语法是:

select * from BetweenDateDemo where StartDate between '2014-8-12' and curdate();

请参阅here 以获取更多参考。

您当前正在使用显式表示法混合介于之间 >

【讨论】:

    猜你喜欢
    • 2016-05-18
    • 1970-01-01
    • 1970-01-01
    • 2021-07-17
    • 1970-01-01
    • 1970-01-01
    • 2015-02-13
    • 1970-01-01
    • 2015-01-07
    相关资源
    最近更新 更多