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

 

 

运用三目运算符可以批量处理字段数据不正确的记录

你可能感兴趣的:(sql,server,null)