sqlserver 中 case when 的用法

  select  case
    when (a.priceType=1) then a.price
    when (a.priceType=2) then a.feePrice/10
    when (a.priceType=3) then a.price
    else 0  end    as jige  from rsc_info a

注意,不要少了 end 结束符。

猜你喜欢

转载自jackroomage.iteye.com/blog/1669136
今日推荐