Say, if I have the following t-SQL statement (designed to run on SQL Server 2008):
UPDATE tbl
SET col1 = (
SELECT MAX(col1) FROM tbl AS t1 WHERE t1.type = tbl.type
);
How exactly does SELECT work in this case:
He chooses, taking into account the results of each UPDATE, or
It selects from tbl, as it was before UPDATE started updating records.
Can anyone clarify this for me?
source
share