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