在一个查询中可能有两个之间?

时间:2014-03-20 12:15:28

标签: mysql sql

在一个查询中是否可以有两个?

 SELECT PH, Chlorine, Temperature, Date, Time FROM googlechart where 
 Date between 2014-03-19 and 2014-03-21 AND
 Time between 15:00 AND 20:00 order by Date, Time;

1 个答案:

答案 0 :(得分:1)

是的,有可能。你只是忘记了日期和时间周围的引号

SELECT PH, Chlorine, Temperature, Date, Time 
FROM googlechart 
where Date between '2014-03-19' and '2014-03-21'
AND Time between '15:00' AND '20:00' 
order by Date, Time;