用SQL取到本月为止的今年所有月份

select lpad(rownum - 0, 2, 0) ymd
  from dual
connect by rownum <= substr('20101130', 5, 2)

编程技巧