SQL check if group contains NULL
Another possibility which doesn't use the fact that count(value)
ignores NULL
values:
select id,
sum(case when value is null then 1 else 0 end) as null_count
from your_table
group by id;
try
select id,
count(*) - count(value) as null_value_count
from your_table
group by id
SQLFiddle demo