mysql - sql query range selection -


hi have table below

year | month | otherdata 2015    1       2015    1        2015    3       2015    4       2015    4 2016    1 2016    2 2016    2 

here how select data of (year 2015/month 4 year 2016/month 2)
tried following query.

select * `schedule_details` (`year` >= 2015 , `month` >= 4) , (`year` <= 2016 , `month` >= 2) 

but not working. how do this? please help

thanks solved problem

select * schedule_details ( year = 2015 , month >= 4 )     or ( year > 2015 , year < 2016 )     or ( year = 2016 , month <= 2 ) 

is there other better way?


Comments