Il problema si chiama Relational Division
.
SELECT group_id
FROM stuff
WHERE member_id IN (11,22,33)
GROUP BY group_id
HAVING COUNT(*) = 3
se member_id
non è univoco per ogni group_id
, devi avere DISTINCT
per contare solo valori univoci.
SELECT group_id
FROM stuff
WHERE member_id IN (11,22,33)
GROUP BY group_id
HAVING COUNT(DISTINCT member_id) = 3
Altre variazioni su questo link: