Swappng Filds - Mailing list pgsql-novice

From Greg Lindstrom
Subject Swappng Filds
Date
Msg-id 43CEAA9D.10905@novasyshealth.com
Whole thread Raw
Responses Re: Swappng Filds  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Swappng Filds  (Michael Fuhr <mike@fuhr.org>)
Re: Swappng Filds  (<operationsengineer1@yahoo.com>)
List pgsql-novice
Hello-
I have a table with values in two columns that I want to swap; that is,
I want the value in column A to now be in column B and the value in
column B to be in column A.  I tried...

UPDATE my_table SET A=B, B=A WHERE mycontition = True

But that seemed to place the value of column B into A, then the new
value of A into B, so both A and B contained value B.  Is there a common
technique to accomplish this?

Thanks,
--greg


pgsql-novice by date:

Previous
From: "Anthony Presley"
Date:
Subject: Huge size of Data directory
Next
From: Tom Lane
Date:
Subject: Re: Huge size of Data directory