DECODE的用法:
DECODE(value,if1,then1,if2,then2,if3,then3,...,else)
表示如果value 等于if1时,DECODE函数的结果返回then1,...,如果不等于任何一个if值,则返回else。
-- oracle decode
select decode(sign(100-100),0,1,2) from dual;
返回 1
DECODE(value,if1,then1,if2,then2,if3,then3,...,else)
表示如果value 等于if1时,DECODE函数的结果返回then1,...,如果不等于任何一个if值,则返回else。
-- oracle decode
select decode(sign(100-100),0,1,2) from dual;
返回 1
本文介绍了Oracle数据库中DECODE函数的基本用法及实例。DECODE函数可根据指定条件返回不同结果,适用于多种场景。例如,通过DECODE函数判断数值大小并返回相应结果。
2395

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



