Oracle中 IF-ELSIF-ELSE 使用

竟然有人问我Oracle的if-else。。

 1 if ... then 
 2 ...   
 3 elsif ... then 
 4 ...   
 5 
 6 else 
 7 ...   
 8 end if;   
 9     
10 
11 or     
12 if ... then     
13   ...   
14 else 
15 ...   
16 end if;   
17     
18 or     
19 if ... then 
20 ...   
21 end if;
22 
23 注:if后的条件不加括号
24 
25 例子:
26            if  val <> 0   then
27                val := 1;
28            end if;

 

posted @ 2016-11-01 10:09  Devil_bubbles  阅读(19232)  评论(2编辑  收藏  举报