oracle decode用法

select decode( x , 1 , ‘x is 1’, 2 , ‘x is 2’, ‘others’) from dual

当x等于1时,则返回‘x is 1’。

当x等于2时,则返回‘x is 2’。

否则,返回‘others’。

原文地址:https://www.cnblogs.com/linjiqin/p/2114856.html