Update query using Subquery in Sql Server

后端 未结 5 1341
走了就别回头了
走了就别回头了 2020-12-02 07:14

I have a simple table Structure like this:

Table tempData

╔══════════╦═══════╗
║   NAME   ║ MARKS ║
╠══════════╬═══         


        
5条回答
  •  不思量自难忘°
    2020-12-02 07:40

    Here in my sample I find out the solution of this, because I had the same problem with updates and subquerys:

    UPDATE
        A
    SET
        A.ValueToChange = B.NewValue
    FROM
        (
            Select * From C
        ) B
    Where 
        A.Id = B.Id
    

提交回复
热议问题