您当前的位置: 首页 >  童心同萌 oracle

Oracle中for语句的使用

童心同萌 发布时间:2019-02-13 12:37:05 ,浏览量:3

set serveroutput on
declare 
  total int;
begin 
  total:=0;
  for i in reverse 1..10 loop
    if mod(i,2)=0 then 
      dbms_output.put_line('total:='||total||'+'||i);
      total:=total+i;
    end if;
  end loop;
  dbms_output.put_line('10以内偶数的和是'||total);
end;

 

关注
打赏
查看更多评论

童心同萌

暂无认证

  • 3浏览

    0关注

    87博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文
立即登录/注册

微信扫码登录