H
Hans
Hi!
Say you have a table A with fields field1, field2, field3 and field4 and I
want to shift values so field1 receives the value from field2, field2
receives the value from field3 and field3 receives the value from field4
(field4 should keep it's value) will a query like
Update A set field1=field2, field2=field3, field3=field4
do the job? Will the right hand side of the assignments always have the
"old" value before the update? What I'm affraid of is that I set
field1=field2 but in the same statement updates field2 will access use the
updated value of field2 and put that into field1? When I test it seems to
work as I want but I would like someone confirm this.
The alternative would be to run three queries and just update one field at a
time but if the right hand side of the assignment always have the "old"
value then I can do the update in one query which will gain performance in
my case.
Regards
/Hans
Say you have a table A with fields field1, field2, field3 and field4 and I
want to shift values so field1 receives the value from field2, field2
receives the value from field3 and field3 receives the value from field4
(field4 should keep it's value) will a query like
Update A set field1=field2, field2=field3, field3=field4
do the job? Will the right hand side of the assignments always have the
"old" value before the update? What I'm affraid of is that I set
field1=field2 but in the same statement updates field2 will access use the
updated value of field2 and put that into field1? When I test it seems to
work as I want but I would like someone confirm this.
The alternative would be to run three queries and just update one field at a
time but if the right hand side of the assignment always have the "old"
value then I can do the update in one query which will gain performance in
my case.
Regards
/Hans