方法一 加or null
count(cast (duration as int)>180 or NULL) as overdue
方法二 加if判断
select count(if( t.command_name = 'UNLOCK' ,1,null)) from t
count(cast (duration as int)>180 or NULL) as overdue
select count(if( t.command_name = 'UNLOCK' ,1,null)) from t
本文标题:count计数里添加条件
本文链接:https://www.haomeiwen.com/subject/uumiydtx.html
网友评论