SQL之case when then用法_之二

select CustomerNo,
       Name,
       Sex,
       Birthday,
       IDType,
       IDNo,
       validityday,
       case (null
            )
         when '1' then
          '高级VIP'
         when '2' then
          '顶级VIP'
         else
          '一般客户'
       end
  from LDPerson
 where 1 = 1
 order by CustomerNo

  这里出现了不是某个字段=1 ,2  而是null=1,null=2,那么相当最后加了一个字段

原文地址:https://www.cnblogs.com/zytcomeon/p/13299503.html