First of all, apologies for the title - wasn't sure how to word it.
Essentially I have this data:
You can try EXISTS as follows:
EXISTS
SELECT * FROM #rules r where exists (select 1 from #rules rr where rr.RuleID = r.RuleID and rr.AccountID <> r.AccountID);
2.1m questions
2.1m answers
60 comments
57.0k users