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;

运行结果:

ORACLE 之 按月循环执行操作

 

相关文章: