>>44
これでもいける
select c1,
case when count(*) = count(c2)
then max(c2)
else 0
end
from t1
group by c1
order by c1