Re: Constructing column from different individual fields in

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Constructing column from different individual fields in
Дата
Msg-id 200309101544.h8AFiSO01239@candle.pha.pa.us
обсуждение исходный текст
Ответ на Re: Constructing column from different individual fields in same row.  (Bruno Wolff III <bruno@wolff.to>)
Список pgsql-general
Bruno Wolff III wrote:
> On Tue, Sep 09, 2003 at 21:02:21 -0700,
>   Alex Martinoff <froggle2003@yahoo.com> wrote:
> > I'm wondering if it's possible to have a query construct a column
> > where the value of the column at each row is taken from another field
> > in that same row. For example, suppose you have a table like:
>
> You can use CASE to do this.

You can also use UNION:

    SELECT col1 ...
    UNION
    SELECT col2 ...

--
  Bruce Momjian                        |  http://candle.pha.pa.us
  pgman@candle.pha.pa.us               |  (610) 359-1001
  +  If your life is a hard drive,     |  13 Roberts Road
  +  Christ can be your backup.        |  Newtown Square, Pennsylvania 19073

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

Предыдущее
От: expect
Дата:
Сообщение: Re: SUMMARY mysql -> psql
Следующее
От: "Jules Alberts"
Дата:
Сообщение: Re: help with TCL function