Subject Re: [ib-support] Oooops i mean Exchange values between Fields in one Update
Author Milan Babuskov
Alan McDonald wrote:
> maybe
> update table set field1=field2, field2=field1
> works?

Nope. But the old +/- trick does:

SQL> create table test (a int, b int);
SQL> insert into test values (1,2);
SQL> select * from test;

A B
============ ============

1 2

SQL> update test set a = a + b, b = a - b, a = a -b;
SQL> select * from test;

A B
============ ============

2 1

By preserving b's value in a, you can retrieve it later.

--
Milan Babuskov
http://fbexport.sourceforge.net