SQL update query using joins

后端 未结 11 1833
天涯浪人
天涯浪人 2020-11-22 01:15

I have to update a field with a value which is returned by a join of 3 tables.

Example:

select
    im.itemid
    ,im.sku as iSku
    ,gm.SKU as GSKU         


        
11条回答
  •  误落风尘
    2020-11-22 01:54

    Try like this...

    Update t1.Column1 = value 
    from tbltemp as t1 
    inner join tblUser as t2 on t2.ID = t1.UserID 
    where t1.[column1]=value and t2.[Column1] = value;
    

提交回复
热议问题