How to combine many rows into one row (by concatenation?) ?

Поиск
Список
Период
Сортировка
От A B
Тема How to combine many rows into one row (by concatenation?) ?
Дата
Msg-id AANLkTimM8gYTu9diccGMslOZuQB585DQRO4q-ENCmH_9@mail.gmail.com
обсуждение исходный текст
Ответы Re: How to combine many rows into one row (by concatenation?) ?  (A B <gentosaker@gmail.com>)
Re: How to combine many rows into one row (by concatenation?) ?  (Andreas Kretschmer <akretschmer@spamfence.net>)
Список pgsql-novice
Hi.

The table is   table foo( id integer, x integer);  and let the data be
id    x
=====
1     10
1     20
2     20
3     30
3     10

Now I would like to get the data in  a format like this

1 , 10 20
2 , 20
3 , 10 30

where id is the first field, and the second field is the x values sorted.

Is there a simple way to do this?

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

Предыдущее
От: Andreas Kretschmer
Дата:
Сообщение: Re: Runnning operating system commands from an SPL
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Runnning operating system commands from an SPL