Answer the question
In order to leave comments, you need to log in
How to update records along with select from another table?
Admin table with three columns AdminID, username, password. Table Users with three of the same columns. How to make a query that would update the password in the Admin table with the password from the Users table, where UserID=123?
Answer the question
In order to leave comments, you need to log in
MySQL:
UPDATE Admins A
JOIN Users U ON U.UserID = A.AdminID
SET A.password = U.password
WHERE U.UserID = 123;
UPDATE Admins
SET Admins.password = U.password
FROM Admins A JOIN Users U ON U.UserID = A.AdminID
WHERE A.AdminID = 123;
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question