This is closely related to this question, but adds another requirement.
Given a parent table \'parent\'
╔════════════╦════════╗ ║ PARENT_ID ║ NAME
If you want to select all parents with at least a 5 and a 1, you can use:
SELECT PARENT_ID FROM rel GROUP BY PARENT_ID HAVING SUM(PROP_ID = 1) AND SUM(PROP_ID = 5) AND SUM(PROP_ID NOT IN (5,1)) = 0
If you need exactly one 5 and one 1, see this answer