Are these two statements equivalent?
UPDATE Table1 SET Field1=(
SELECT Field2 FROM Table2
WHERE Table1.ID=Table2.ID
)
FROM Table1
WHERE Field1 is null
UPDATE t SET Field1=(
SELECT Field2 FROM Table2
WHERE t.ID=Table2.ID
)
FROM Table1 t
WHERE Field1 is null
I'm trying to reduce the amount of aliasing. I feel that adding an alias to a statement only adds another table name to keep track of mentally.
My concern is that in example 1, since I'm not using the alias, it will update the entire table1 instead of filtering on the WHERE Field1 is null.
What is the rule of thumb for when aliasing is required?