转自 :http://www.jb51.cc/article/p-xrqumgiv-k.html
获取日期列表:
获取月份列表:
copy
SELECTTO_CHAR(ADD_MONTHS(TO_DATE('2014-10','yyyy-MM'),ROWNUM-1),
'yyyyMM')asmonthlist
FROMDUAL
BYROWNUM<=
months_between(to_date('2015-06',248)"> to_date('2014-10','yyyy-MM'))+1
获取年份列表: