Skip to content

Instantly share code, notes, and snippets.

@stevesohcot
Created October 18, 2020 01:35
Show Gist options
  • Save stevesohcot/32ec419c51ed9a3d4330bceedf93c8e3 to your computer and use it in GitHub Desktop.
Save stevesohcot/32ec419c51ed9a3d4330bceedf93c8e3 to your computer and use it in GitHub Desktop.
SQL to Update based on a second table
UPDATE tblData
SET
tblData.field_one = tblSource.field_one
FROM
myTableNameHere tblData
INNER JOIN myOtherTableNameHere tblSource ON
tblData.id = tblSource.id
WHERE
tblData.field_with_criteria = 'x'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment