`

sql server 三目运算符

阅读更多
case when c.zsdecScore is null then 0 else c.zsdecScore end

select c.dutydeptname,c.dutydeptcode,c.stdscore, c.targettype,c.zsdecScore,(c.stdscore-(case when c.zsdecScore is null then 0 else c.zsdecScore end)
)/c.stdscore*100 as  avg



应该是:
select   case   when   col <=0   then   0   else   col   end 
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics