码迷,mamicode.com
首页 > 其他好文 > 详细

decode&case

时间:2017-11-10 00:24:29      阅读:151      评论:0      收藏:0      [点我收藏+]

标签:xxx   from   cas   when   bsp   else   decode   case   type   

select id, decode (type,1,a,2,b,3,c,999) from xxx;

select name, (case when score<0 then ‘d‘

when score <60 then ‘d‘

when score<=60  then  ‘c‘

else ‘b‘ end  )from xxx;

 

decode&case

标签:xxx   from   cas   when   bsp   else   decode   case   type   

原文地址:http://www.cnblogs.com/abcyrf/p/7811878.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!