Můžete použít HAVING COUNT
. Číslo by muselo být také dynamicky.
SELECT person_id
FROM interest
WHERE interest_category IN ( 'music', 'movie', 'sport');
GROUP BY person_id
HAVING COUNT(*) = 3;
Můžete použít HAVING COUNT
. Číslo by muselo být také dynamicky.
SELECT person_id
FROM interest
WHERE interest_category IN ( 'music', 'movie', 'sport');
GROUP BY person_id
HAVING COUNT(*) = 3;