标签:line str 个数 大于 div 循环 else when from
一、分支语句
set serveroutput on declare num number; begin num:=3; if num = 5 then dbms_output.put_line(‘这个数字是5‘); elsif num >7 then dbms_output.put_line(‘这个数字大于7‘); else dbms_output.put_line(‘其他数字‘); end if; end;
二、循环语句
1.loop循环
set serveroutput on declare num number; begin num := 1; loop exit when num > 10; dbms_output.put_line(num); num := num + 1; end loop; end;
2.while循环
set serveroutput on declare num number; begin num := 1; while num < 10 loop dbms_output.put_line(num); num := num + 1; end loop; end;
3.for循环
set serveroutput on declare num number; begin num := 1; for ii in (select sname from student) loop dbms_output.put_line(ii.sname); end loop; end;
标签:line str 个数 大于 div 循环 else when from
原文地址:http://www.cnblogs.com/bekeyuan123/p/7019996.html