sql case when

来源:互联网 发布:360域名检测 编辑:程序博客网 时间:2024/05/06 13:38
select t1.mainregion 运作地,
       t1.customercode 客户编号,
       t1.customernamecn 名称,
       --t1.businesstype,
       case when t1.businesstype = 'IMP' then '进口'
            when t1.businesstype = 'EXP' then '出口'
            when t1.businesstype = 'SAL' then '销售'
            when t1.businesstype = 'TRS' then '物流'
            end businesstype,
       t1.createdate 创建时间,
       e.name 商务经理,
       'tel:' || e.telephone || ' mobile:' || e.mobilephone tel,
       case when t1.islock = 'N' then '否'
            when t1.islock = 'Y' then '是'
            end islock
  from eapt_customer t1, employee e
 where (t1.warehouseftcout = 56
    or t1.warehouseftcin = 56) and e.username = t1.principal2 
原创粉丝点击