Reputation: 1295
I'm swapping column values in a table using the following statement:
UPDATE SwapTable
SET ValueA=ValueB
,ValueB=ValueA
This works and the values do get swapped, as can be verified by this SQL Fiddle.
However, if we did such thing in (mostly any) other language, we would end up with both ValueA
and ValueB
having identical values.
So my question is why/how this works in SQL.
Upvotes: 1
Views: 149
Reputation: 915
You can just see the execution plan.
Upvotes: 4