This is something that I don’t do often, but it pops up every now and again. I always forget how to do it, so I have to look it up each time.

Here is an example:

UPDATE alias
SET
 col1 = value,
 col2 = value,
 col3 = value
FROM table1 alias
 INNER JOIN table2 blah
  ON alias.pk = blah.pk
WHERE otherconditions

Leave a Reply

Your email address will not be published. Required fields are marked *