Ad Code

MySQL Update Column from other column in same table

You can make a self-join with the multiple table UPDATE syntax:

UPDATE users u
  JOIN users s ON s.SUPERVISOR_USERNAME = u.USERNAME
SET    u.SUPERVISOR_ID = s.ID

Post a Comment

0 Comments