`
本来不想注册
  • 浏览: 190033 次
  • 性别: Icon_minigender_1
  • 来自: 杭州
社区版块
存档分类
最新评论

Decode

 
阅读更多
Decode函数的语法结构如下: decode (expression, search_1, result_1, search_2, result_2,... ., search_n, result_n, default) decode函数比较表达式和搜索字,如果匹配,返回结果;如果不匹配,返回default值;如果未定义default值,则返回空值。

 select id as aa,decode(id,'1','Y','2','N','3','s','sdfsd') as a  from queryinfo


  示例如下:

  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’。
分享到:
评论
1 楼 click_guobin 2011-04-14  
反驳你的用户名  幸好你注册了  不然我也看不到想要的,呵呵  谢谢

相关推荐

Global site tag (gtag.js) - Google Analytics