📜  从另一个表更新 sql server - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:32.240000             🧑  作者: Mango

代码示例2
-- 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;