标签:
/*SELECT TO_CHAR(TO_DATE(‘2009-04-1‘, ‘YYYY-MM-DD‘) + ROWNUM - 1, ‘YYYY-MM-DD‘) DAY_ID FROM DUAL CONNECT BY ROWNUM <= trunc(to_date(‘2009-05-23‘, ‘yyyy-mm-dd‘) - to_date(‘2009-04-1‘, ‘yyyy-mm-dd‘)) + 1 */ /*SELECT TO_CHAR(ADD_MONTHS(TO_DATE(‘2015-01‘, ‘YYYY-MM‘), ROWNUM - 1), ‘YYYY-MM‘) DAY_ID FROM DUAL CONNECT BY ROWNUM <= months_between(to_date(‘2016-09‘, ‘yyyy-mm‘), to_date(‘2015-01‘, ‘yyyy-mm‘)) + 1*/ SELECT replace(TO_CHAR(ADD_MONTHS(TO_DATE(‘2015-01‘, ‘YYYY-MM‘), ROWNUM - 1), ‘YYYY-MM‘),‘-‘,‘年‘)||‘月‘ yearmonth FROM DUAL CONNECT BY ROWNUM <= months_between(sysdate, to_date(‘2015-01‘, ‘yyyy-mm‘)) + 1
标签:
原文地址:http://my.oschina.net/chworld/blog/530792