阅读背景:

Oracle流程控制语句

来源:互联网 

if...else

set serverout on; declare n number:=1; v varchar2(20):='world'; begin dbms_output.put_line('hello'||n||v); end; set serverout on; declare emp_count number; begin select count(*) into emp_count from emp where sal>=3000; if emp_count>0 then dbms_output.put_line('有'||emp_count||'个员工的基本薪资大于等于3000'); else dbms_output.put_line('没有员工的基本薪资大于等于3000'); end if; end; set serverout on; declare emp_count number; begin select count(*) into emp_count from emp where sal>=3000; if emp_count=1 then dbms_output.put_line('有1个员工的基本薪资大于等于3000'); else if emp_count>1 then dbms_output.put_line('有超过1个员工的基本薪资大于等于3000'); else dbms_output.put_line('没有员工的基本薪资大于等于3000'); end if; end if; end; set serverout on; declare n number:=1; v



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: