0
嗨,我有一个像下面SQL查询范围选择
year | month | otherdata
2015 1
2015 1
2015 3
2015 4
2015 4
2016 1
2016 2
2016 2
这里我该如何选择(2015年/ 4月至2016年/月2)
我尝试以下查询的所有数据表。
select * from `schedule_details` where (`year` >= 2015 and `month` >= 4) and (`year` <= 2016 and `month` >= 2)
但它不工作。我该怎么做呢?请帮助
难道你不想在where子句的第二部分使用'month'<= 2吗? – Lex