Subject Re: [firebird-support] Exchange two column values in a single statement...
Author Svein Erling Tysvaer
Dmitry Yemanov wrote:
> Milan Babuskov wrote:
>> update t1 set a = a+b, b = a-b, a = a-b;
>
> This won't work in the next FB version, so I wouldn't rely on this approach.

I'm surprised that things are evaluated left to right and that a and b
have changing values. Intuitively, without looking at any SQL standard
or thinking too deeply, I'd rather expect

update t1 set a = b, b = a

to swap the values of two fields and a and b to be 'static' - always
referring to the old value of a or b - when on the right side of an
assignment.

Will the next FB version behave this way?

Set