Answers for "update one table from another table in sql"

SQL
3

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;
Posted by: Guest on October-18-2021
2

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;
Posted by: Guest on May-13-2020
0

mysql update table from select on another table

UPDATE TableB 
SET TableB.value = (
    SELECT TableA.value 
    FROM TableA
    WHERE TableA.name = TableB.name
);
Posted by: Guest on November-19-2019

Code answers related to "update one table from another table in sql"

Code answers related to "SQL"

Browse Popular Code Answers by Language