SELECT TO_CHAR (ADD_MONTHS (TO_DATE ('2011-03', 'yyyy-mm'), ROWNUM - 1),'YYYY-MM') AS yearmonth FROM all_objects
WHERE ROWNUM <=(SELECT MONTHS_BETWEEN (TO_DATE ('2012-07', 'yyyy-mm'),TO_DATE ('2011-03', 'yyyy-mm')) FROM DUAL)
SELECT TO_CHAR (ADD_MONTHS (TO_DATE ('2011-03', 'yyyy-mm'), ROWNUM - 1),'YYYY-MM') AS yearmonth FROM all_objects
WHERE ROWNUM <=(SELECT MONTHS_BETWEEN (TO_DATE ('2012-07', 'yyyy-mm'),TO_DATE ('2011-03', 'yyyy-mm')) FROM DUAL)