In the last weeks I came to work with SQL Server more closely and - not being used to it - I stumbled over the sematics of an UPDATE statement using a JOIN (something which is not available in e.g. Oracle).
I wonder what the difference between these two updates is:
and
In both cases I have an inner join between foo and bar, but in the second one, foo is actually listed twice in the update statement.
As far as I can tell, both carry out the same thing - at least with my test data.
So my question is: is there a difference between the two, and if yes, what exactly is the difference?
I wonder what the difference between these two updates is:
Code:
update foo
set ..
from bar
where bar.fid = foo.id;
Code:
update foo
set ...
from foo f1
join bar on bar.fid = f1.id;
As far as I can tell, both carry out the same thing - at least with my test data.
So my question is: is there a difference between the two, and if yes, what exactly is the difference?