ORACLE 之 按月循环执行操作

DECLARE
  i number;
BEGIN
  i:= 201705;
  WHILE i <202104 LOOP
  if i=201713 then
  i:=201801;
  elsif i=201813 then
  i:=201901;
  elsif i=201913 then
  i:=202001;
  elsif i=202013 then
  i:=202101;
end if;
  DBMS_OUTPUT.PUT_LINE(i);
  i := i + 1;
  END LOOP;
END;

运行结果:

 

posted on 2021-05-13 14:24  Simple-Sir  阅读(592)  评论(0编辑  收藏  举报

导航