我有一个mysql行,其中'date = 2013-05-02,type = 1'等。
然后我运行此查询
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
但这会返回空结果。这里的查询问题是什么?
答案 0 :(得分: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 ;
答案 1 :(得分:0)
尝试BETWEEN'2013-05-01'和'2013-05-08'