`

case when 和 decode函数基本使用

SQL 
阅读更多
decode用法 其中的参数跟查询字段的类型有关系t.kl
        select decode(t.kl,1,'已推送',2,'推送中',3,'推送失败','未推送') from xzm_1 t 


case when end 用法
  select  
       case  t.kl 
             when '1' then '已推送'
             when '2' then '推送中'
             when '3' then '推送失败'
             else 
               '未推送'
        end 
       from    xzm_1 t 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics