Ok 3 tables, Users, Groups, and UserGroups.
The important columns are Users.UserID, Groups.GroupID, UserGroups.UserID, and UserGroups.GroupID.
I have a group we'll call group 'A', there are a bunch of Users in this group because there are many rows of UserGroups where the GroupID is the GroupID of group 'A'.
Now for all the users who do not have this UserGroup association I want to insert a new UserGroup association for group 'B'.
So, put all users not in group 'A' into group 'B', a user is in a group when there is a UserGroup with that UserID and that GroupID in existence.
How can I write a query that will insert a UserGroup of UserID and GroupID of group 'B' for all the users that do not already have a UserGroup with the GroupID of group 'A'?
Also, how can I add additional GroupIDs to the exclusion? Meaning if there was a group 'C' as well and I only wanted to add the users to group 'B' who are in neither 'A' nor 'C'?