I have an old database, and a new database. The old database had various usergroups, with users inside of each usergroup. The new database has these same usergroups, but by accident, all users were put into only one usergroup.
I have the old list of usernames (or user ID's), and I want to move them into their corresponding usergroup.
How would I do this with an SQL query?
For example:
100 users in the new database are currently in user group "1", which I want to move to usergroup "2". Usergroup 1 already has 2,000 users, so I can't just move all users into Usergroup 2. But, I have the list of 100 user's user ID's (and usernames) in order to select them.
The relevant column names are: "userid" "usergroupid" "username"
and they are all in the table "user".
Thank you!
Note: The old database is not connected to the new database. I have the list of old user ID's/usernames in a comma delimited format.