if判断语句
6)if判断语句
if ... then
else
end if;
if ... then
elsif ... then
elsif ... then
else
end if;
declare
sex char(1) := 'M';
begin
if sex='M' then
dbms_output.put_line('支持文章');
elsif sex='F'then
dbms_output.put_line('支持马伊琍');
else
dbms_output.put_line('支持姚笛');
end if;
end;
/
//有一个NUMBER(3)变量,
如果大于0显示1;
如果小于0显示-1;
如果等于0显示0;
declare
n number(3) :=10;
begin
if n>0 then
dbms_output.put_line(1);
elsif n<0 then
dbms_output.put_line(-1);
else
dbms_output.put_line(0);
end if;
end;
/
随笔有些是自己写的,有些是根据网上的东西自己整理的,文章基本都是别人的,只是为方便查看复制到那里

浙公网安备 33010602011771号