我的MySql表'a'
中有一行,其值为'date'='2015-06-01'
和'hour' = 17:00:00
我的问题是我可以通过
选择这一行hour BETWEEN "16:30:00" AND "17:30:00"
但我不能date = 2015-06-01
。
我需要这样的完整陈述:
SELECT * FROM `a`
WHERE (date = 2015-06-01)
AND (hour BETWEEN "16:30:00" AND "17:30:00")
答案 0 :(得分:0)
你需要在日期周围引用
SELECT * FROM `a`
WHERE `date` = '2015-06-01'
AND `hour` BETWEEN '16:30:00' AND '17:30:00'