I have not tested this but you can try:
Code:
UPDATE user SET membergroupids = REPLACE(membergroupids,'2','');
So based on that, it reads:
Update all users, set their member group id (secondary usergroup) to "Blank" or '' where it currently is 2 i.e. Registered User/Member.
Now go through and do this for all the secondary usergroups listed in the usergroup manager so if you have a custom usergroup none of us have lets call it Main VIP which is usergroupid #29 you simply use this now:
Code:
UPDATE user SET membergroupids = REPLACE(membergroupids,'29','');
^ This should clear out all the secondary usergroups yet leave the primary remaining. If your asking how to do this query be sure to run a backup beforehand just to be safe.
Edit: Ahh I had to install a staging site on my localhost tonight regardless so tested and it works

.