SQL update from one Table to another based on a ID match

后端 未结 22 1583
太阳男子
太阳男子 2020-11-21 22:49

I have a database with account numbers and card numbers. I match these to a file to update any card numbers to the account number, so

22条回答
  •  轮回少年
    2020-11-21 23:16

    Use the following block of query to update Table1 with Table2 based on ID:

    UPDATE Sales_Import, RetrieveAccountNumber 
    SET Sales_Import.AccountNumber = RetrieveAccountNumber.AccountNumber 
    where Sales_Import.LeadID = RetrieveAccountNumber.LeadID;
    

    This is the easiest way to tackle this problem.

提交回复
热议问题