Du kan använda HAVING COUNT
. Numret måste också vara dynamiskt.
SELECT person_id
FROM interest
WHERE interest_category IN ( 'music', 'movie', 'sport');
GROUP BY person_id
HAVING COUNT(*) = 3;
Du kan använda HAVING COUNT
. Numret måste också vara dynamiskt.
SELECT person_id
FROM interest
WHERE interest_category IN ( 'music', 'movie', 'sport');
GROUP BY person_id
HAVING COUNT(*) = 3;