Mysql
 sql >> Base de données >  >> RDS >> Mysql

mysql - impossible de spécifier la table cible pour la mise à jour dans la clause from

UPDATE `user`
SET email='[email protected]'
WHERE id = (SELECT id FROM (SELECT IF((SELECT admin FROM user WHERE id = '1') > 2,
                                      (SELECT id FROM user WHERE id = '2'),
                                      (SELECT id FROM user WHERE id = '1')) AS id
                           ) AS t
           );