-- Something like this should do it for you:
-- 1st determine the ones in account_badge that have > 1 unique account_id's
With ab_list as (
select account_badge_id, count( distinct account_id ) as badge_id_acct_count
from account_badge
where badge_status_id in( 1, 2 )
group by...