try this:
select id
,sign(sum(case when col is null then 0 else 1 end)) as flag
from thetable as a
group by id
order by id
edit:
the above does not work as intended, try this instead:
select id
,case when sum(case when col is null then 0 else 1 end)>2 then 1 else 0 end as flag
from thetable as a
group by id
order by id