declare
begin_date date default to_date('2009-02-02','yyyy-mm-dd');
end_date date default to_date('2009-02-10','yyyy-mm-dd');
l_date date;
l_day int;
begin
l_day:=end_date-begin_date;
l_date:=begin_date;
for i in 1 .. l_day
loop
dbms_output.put_line('Date : '||to_char(l_date,'yyyy-mm-dd'));
l_date:=l_date+1;
end loop;
end;
结果为:
Date : 2009-02-02
Date : 2009-02-03
Date : 2009-02-04
Date : 2009-02-05
Date : 2009-02-06
Date : 2009-02-07
Date : 2009-02-08
Date : 2009-02-09
posted on 2009-04-01 11:48
周锐 阅读(804)
评论(0) 编辑 收藏 所属分类:
Oracle