update sql server from another table
UPDATE t1
SET t1.column = t2.column
FROM Table1 t1
INNER JOIN Table2 t2 ON t1.id = t2.id;
update sql server from another table
UPDATE t1
SET t1.column = t2.column
FROM Table1 t1
INNER JOIN Table2 t2 ON t1.id = t2.id;
sql update from different table
-- SQL Server
UPDATE Sales_Import
SET Sales_Import.AccountNumber = RAN.AccountNumber
FROM Sales_Import SI
INNER JOIN RetrieveAccountNumber RAN
ON SI.LeadID = RAN.LeadID;
-- MySQL & MariaDB
UPDATE Sales_Import SI, RetrieveAccountNumber RAN
SET SI.AccountNumber = RAN.AccountNumber
WHERE SI.LeadID = RAN.LeadID;
mysql update table from select on another table
UPDATE TableB
SET TableB.value = (
SELECT TableA.value
FROM TableA
WHERE TableA.name = TableB.name
);
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us