Table inventory_month
has three fields id
, month_month
and month_year
id month_month month_year 1 09 2012 2 10 2012 3 11 2012 4 01 2013 5 02 2013 6 03 2013 7 09 2013 8 10 2013
I need result FROM October 2012 TO October 2013 as below
Expected result
id month_month month_year 2 10 2012 3 11 2012 4 01 2013 5 02 2013 6 03 2013 7 09 2013 8 10 2013
But getting result below
Getting result
id month_month month_year 2 10 2012 8 10 2013
I have tried query below
select id,month_month,month_year where month_month>=10 AND month_year>=2012 AND month_month<=10 AND month_year<=2013
Need helpful suggestion, Thanks!
Use,
SELECT id,month_month,month_year WHERE
(month_month >= 10 AND month_year = 2012)
OR
(month_month <= 10 AND month_year = 2013)
Collected from the Internet
Please contact [email protected] to delete if infringement.
Comments