Lo más sencillo sería usar group by
y having
:
SELECT group_name
FROM table2 g
JOIN table1 t on g.group_id = t.group_id
WHERE t.item in (765,656)
GROUP BY group_name
HAVING COUNT(DISTINCT t.item) = 2
Lo más sencillo sería usar group by
y having
:
SELECT group_name
FROM table2 g
JOIN table1 t on g.group_id = t.group_id
WHERE t.item in (765,656)
GROUP BY group_name
HAVING COUNT(DISTINCT t.item) = 2