0

我有一个带有'date = 2013-05-02,type = 1'等的mysql行。

然后我运行这个查询

SELECT date, type, status, rate 
FROM reservation 
WHERE  type = 1 
AND date BETWEEN 2013-05-01 AND 2013-05-08  
ORDER BY date asc 
LIMIT 0, 10

但这会返回空结果。这里的查询问题是什么?

4

2 回答 2

2

将日期放在'mysql 查询中的引号中。

SELECT date, type, status, rate 
FROM reservation 
WHERE  type = 1 
AND date BETWEEN '2013-05-01' AND '2013-05-08'
ORDER BY date ASC
LIMIT 0, 10 ;
于 2013-05-19T17:08:26.240 回答
0

尝试在“2013-05-01”和“2013-05-08”之间

于 2013-05-19T17:12:42.123 回答