列出时间段内的每个日期:
select to_char(to_date('2011-04-01', 'yyyy-mm-dd') + rownum,'yyyy-mm-dd')
from (select rownum - 1 rnum
from all_objects
where rownum < to_date('2011-04-05', 'yyyy-mm-dd') -
to_date('2011-04-01', 'yyyy-mm-dd') + 1) t
where t.rnum > -1
结果:
2011-04-02
2011-04-03
2011-04-04
2011-04-05