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’。

posted on 2011-07-23 14:44  Ruthless  阅读(1093)  评论(0编辑  收藏  举报