id date temp prcp
1 2015-01-01 -27.18 0
1 2015-01-02 -25.9 1.03
1 2015-01-03 -17.89 9.44
1 2015-01-04 -17.89 9.44
1 2015-01-05 -17.89 9.44
SELECT * FROM tbl WHERE id=1 and date between '2015-01-03' and '2015-01-05'
How do I fix the SQL query above? I am trying to extract all rows between the 2 dates '2015-01-03' and '2015-01-05'
date >= '2015-01-03' and date <= '2015-01-05'?between?BETWEENexpression in parens, to separateBETWEEN ... ANDfrom logicalAND:SELECT ... WHERE (x BETWEEN v1 AND v2) AND other stuff. Maybe put your between in parens?