Let\'s suppose I have a table T1 with people IDs and other stuff IDs, as the following
Table: T1
personID | stuffID
1 | 1
1 | 2
1
select personID from T1 group by personID having count(distinct stuffID) in (select count(distinct stuffID) from T2)
select count(distinct stuffID) from T2 <-- Would give the total number of distinct countIDs
group by personID having count(distinct stuffID) <-- after grouping by personId , counting the number of stuffIds that personId has.
So both the counts should be equal to get the desired result.