Re: Swappng Filds

Поиск
Список
Период
Сортировка
От
Тема Re: Swappng Filds
Дата
Msg-id 20060202011303.48920.qmail@web33309.mail.mud.yahoo.com
обсуждение исходный текст
Ответ на Swappng Filds  (Greg Lindstrom <greg.lindstrom@novasyshealth.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

this might be way off base, but why not leave the data
and swap the column names?

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around
http://mail.yahoo.com

В списке pgsql-novice по дате отправления:

Предыдущее
От:
Дата:
Сообщение: Re:
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Reverting from subtables to no subtables.