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 tracklist WHERE 'date' >= '2013-07-09'
返回和之前的数据
SELECT * FROM tracklist WHERE 'date' <= '2013-07-09'
在给定日期之后返回数据?对应的 MySQL 列是 'date' ,其条目如 '2009-06-05'。为什么它以我要求的另一种方式使用 MySQL?
'date'是一个字符串...我认为您可能打算使用反引号(`)。
'date'
更一般地说,最好将字符串显式转换为日期:
SELECT * FROM tracklist WHERE `date` >= DATE '2013-07-09'
和
SELECT * FROM tracklist WHERE `date` <= DATE '2013-07-09'