tsql - updating a table from a select statement

后端 未结 2 1186
闹比i
闹比i 2021-01-27 13:38

I have two tables. TableA and TableB.
TableA holds a varbinary(max) column - named [BinaryA] TableB holds a column (named \"Volume\", type \"Long\") that contains each varbi

2条回答
  •  被撕碎了的回忆
    2021-01-27 14:17

    UPDATE tableB
    SET    [volume] = (SELECT RetrieveAccountNumber.AccountNumber 
                              FROM   RetrieveAccountNumber 
                              WHERE  tableB.leadid =RetrieveAccountNumber.LeadID) 
    WHERE Sales_Import.leadid = (SELECT  RetrieveAccountNumber.LeadID 
                                 FROM   RetrieveAccountNumber 
                                 WHERE  tableB.leadid = RetrieveAccountNumber.LeadID)
    

提交回复
热议问题