Update command with a join

A while back, I showed how you can use a Delete command in conjunction with a join.

Note that you can also use this when performing an Update!

So, use this handy approach if your update is conditional on data from another table.

UPDATE a
SET a.Column2 = '2'
FROM Table1 a
INNER JOIN Table2 b
  ON b.Identifier = a.Identifier
WHERE b.Column1 = '1'
Subscribe

0 comments