Ik raad aan om hiervoor simple join te gebruiken:
SELECT DISTINCT a.lot, b.lot
FROM mytable a
INNER JOIN mytable b ON b.product = a.product AND NOT EXISTS (SELECT * FROM product WHERE tag NOT IN (a.tag, b.tag))
WHERE a.tag = 101 and b.tag = 102
Ik raad aan om hiervoor simple join te gebruiken:
SELECT DISTINCT a.lot, b.lot
FROM mytable a
INNER JOIN mytable b ON b.product = a.product AND NOT EXISTS (SELECT * FROM product WHERE tag NOT IN (a.tag, b.tag))
WHERE a.tag = 101 and b.tag = 102