Swappng Filds

Поиск
Список
Период
Сортировка
От Greg Lindstrom
Тема Swappng Filds
Дата
Msg-id 43CEAA9D.10905@novasyshealth.com
обсуждение исходный текст
Ответы Re: Swappng Filds  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Swappng Filds  (Michael Fuhr <mike@fuhr.org>)
Re: Swappng Filds  (<operationsengineer1@yahoo.com>)
Список 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 по дате отправления:

Предыдущее
От: "Anthony Presley"
Дата:
Сообщение: Huge size of Data directory
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Huge size of Data directory