How can I do an UPDATE statement with JOIN in SQL Server?

前端 未结 16 1518
名媛妹妹
名媛妹妹 2020-11-21 11:51

I need to update this table in SQL Server with data from its \'parent\' table, see below:

Table: sale

id (int)
udid         


        
16条回答
  •  半阙折子戏
    2020-11-21 12:12

    For SQLite use the RowID property to make the update:

    update Table set column = 'NewValue'
    where RowID = 
    (select t1.RowID from Table t1
    join Table2 t2 on t1.JoinField = t2.JoinField
    where t2.SelectValue = 'FooMyBarPlease');
    

提交回复
热议问题