select decode(1,2,3,11,4,15,11,14,19,17) tt from dual;
if 1=2 then
3
elsif 1=11 then
4
elsif 1=15 then
11
elsif 1=14 then
19
elsif 1=17 then
17
endif;
select decode(1,2,3,11,4,15,11,14,19,1,2,4) tt from dual;
if 1=2 then
3
elsif 1=11 then
4
elsif 1=15 then
11
elsif 1=14 then
19
elsif 1=1 then
2
endif;
Oracle SQL 解码函数与条件语句示例
本文提供两个使用 Oracle SQL 的示例,第一个示例展示了如何使用 DECODE 函数进行条件判断,第二个示例则通过 IF 语句实现类似的条件逻辑。这些示例有助于理解 SQL 中条件表达式的应用。
645

被折叠的 条评论
为什么被折叠?



