标签:
年份段:
SELECT TO_CHAR(add_months(to_date(‘2015‘, ‘yyyy‘), -(ROWNUM - 1)*12), ‘yyyy‘) YEAR FROM dual CONNECT BY ROWNUM <= 5
结果:
月份段:
SELECT TO_CHAR(add_months(to_date(‘2015-12-01‘, ‘yyyy-mm-dd‘), -(ROWNUM - 1)), ‘yyyy-mm-dd‘) dt FROM dual CONNECT BY ROWNUM <= 5
结果:
标签:
原文地址:http://my.oschina.net/chenhao901007/blog/364330