Something like
select id
, sum ( case when col1 is null then 1 else 0 end case ) col1
, sum ( case when col2 is null then 1 else 0 end case ) col2
, sum ( case when col3 is null then 1 else 0 end case ) col3
from contacts
group by id
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…