If I understand correctly, you want to retrieve all the personID's from T1 that have all associated stuffID's found in T2.
You can break this up as follows:
First of all, find all the T1 entries that match with a nested query
SELECT personID
FROM T1 WHERE stuffID IN (SELECT stuffID FROM t2)
Now you need to check which of the entries in this set contains ALL the stuffID's you want
GROUP BY personID
HAVING COUNT(DISTINCT stuffID) = (SELECT COUNT(stuffID) FROM t2)
and put it all together:
SELECT personID
FROM T1 WHERE stuffID IN (SELECT stuffID FROM t2)
GROUP BY personID
HAVING COUNT(DISTINCT stuffID) = (SELECT COUNT(stuffID) FROM t2)
HTH.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…