Skip to content

Instantly share code, notes, and snippets.

@MarioBinder
Created December 14, 2017 06:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MarioBinder/fc8102010658866cfbc76cd77e1ba944 to your computer and use it in GitHub Desktop.
Save MarioBinder/fc8102010658866cfbc76cd77e1ba944 to your computer and use it in GitHub Desktop.
SQL Update with Inner Join
UPDATE s
SET s.IsFreezed = 1
FROM [DBNAME].[dbo].[COLUMN] AS s
INNER JOIN [DBNAME].[dbo].[COLUMN] AS m
ON s.Id = m.StatusId
WHERE m.Subject = 'xxxxx'
AND s.HasSent = 0;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment