Hi,
I'd like to do an update of field groupID in table membership_users for selection of users from other table where they are selected by command:
SELECT DISTINCT Schvalovatel1 FROM `role`,
my question is how to write an update command correctly:
UPDATE `membership_users` SET `groupID` = 5 WHERE `custom2` = SELECT DISTINCT Schvalovatel1 FROM `role`
Many thanks in advance.
Update a groupID for several distinct users selected from column of other table
Re: Update a groupID for several distinct users selected from column of other table
Hi,
try using
UPDATE `membership_users` SET `groupID` = 5 WHERE `custom2` in ( SELECT DISTINCT Schvalovatel1 FROM `role`)
try using
UPDATE `membership_users` SET `groupID` = 5 WHERE `custom2` in ( SELECT DISTINCT Schvalovatel1 FROM `role`)
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.