Dit heet Relationele divisie
SELECT a.name
FROM parent a
INNER JOIN rel b
ON a.parent_ID = b.parent_ID
WHERE b.prop_id IN (1,5)
GROUP BY a.name
HAVING COUNT(*) = 2
UPDATE 1
if unieke beperking werd niet afgedwongen op prop_id
voor elke parent_id
, DISTINCT
is nodig in dit geval.
SELECT a.name
FROM parent a
INNER JOIN rel b
ON a.parent_ID = b.parent_ID
WHERE b.prop_id IN (1,5)
GROUP BY a.name
HAVING COUNT(DISTINCT b.prop_id) = 2