SQL Server - UPDATE table where ID is in SELECT?

Viewed 42701

I have a table where I want to update all rows with the ID that exists in the select result.

My pseudo-code:

UPDATE mytable as t
   SET t.status = 'PM'
 WHERE t.ID EXISTS IN (select ID from ...)

I have managed to do the select statement, now I want to use the result of the select statement to update a table.

2 Answers
Related