There is a table tbl_user_groups with fields of the form user_id, group_id. There are a lot of groups.
Records of the form (example): user_id=2, group_id=3 user_id=4, group_id=8 user_id=2, group_id=7 user_id=8, group_id=3 user_id=6, group_id=8 user_id=1, group_id=4 selection of those user_id, which consist in all selected groups from the set, but in others they should not consist (which are not from the list).
Something like SELECT user_id FROM tbl_user_groups WHERE group_id in (3,4,7,8) GROUP BY user_id // Но нужно ещё, чтобы такой пользователь (user_id) не был (не состоял) участником групп, кроме тех, которые перечислены
How to do it? Thank!