I have multiple IN conditions with subqueries.
SELECT
S.name,
S.email
FROM something S
WHERE
1 NOT IN (SELECT id FROM tags WHERE somethingId = S.id)
AND 2 NOT IN (SELECT id FROM tags WHERE somethingId = S.id)
AND 3 NOT IN (SELECT id FROM tags WHERE somethingId = S.id)
Maybe there are better solutions? Something like:
(1, 2, 3) NOT IN (SELECT id FROM tags WHERE somethingId = S.id)
JOINorEXISTS()as they are faster and more flexible in many situations.