Swap values
October 28, 2009 - 8pm Central time zone
Reviewer: A reader
And that's a good thing because it makes it very easy to swap values in two columns "update t set
x=y, y=x"
Is there a compelling reason why the standard requires rvalue evaluation first ?
October 29, 2009 - 8pm Central time zone
Reviewer: Ron
Hi Tom,
Thanks for your earlier response.
Is there a compelling reason why the standard requires rvalue evaluation first ?
Followup October 30, 2009 - 9am Central time zone:
it only makes sense, there is no "order of operation of a where clause and such"
select * from t where x > 5 and y < 10 and z > 20;
select * from t where x > 5 and (y < 10 and z > 20);
select * from t where (x > 5 and y < 10) and z > 20;
select * from (select * from (select * from t where x>5) where y<10) where z>20;
those are all identical, you have no control over the order of evaluation.
it would not make any sense to have an order, it is not like a procedural language - things are not processed "right to left" or "left to right" or "bottom up" or "top down", they are done in any order we want.

November 6, 2009 - 1am Central time zone
Reviewer: Helena Marková from Bratislava, Slovakia
|