table 1 item group_id 123 aaaa 432 bbbb 534 aaaa 765 cccc 656 aaaa 656 cccc 111 cccc group_id group_name aaaa groupA bbbb
SELECT DISTINCT t1.group_name FROM table1 t1 join table1 t2 join groups g ON t1.group_id = t2.group_id and t1.item = 765 and t2.item = 656 and g.group_id = t1.group_id