Re: combine multiple row values in to one row

Поиск
Список
Период
Сортировка
От Ivan Sergio Borgonovo
Тема Re: combine multiple row values in to one row
Дата
Msg-id 20090707022235.6bd1e038@dawn.webthatworks.it
обсуждение исходный текст
Ответ на combine multiple row values in to one row  (Lee Harr <missive@hotmail.com>)
Список pgsql-general
On Tue, 7 Jul 2009 01:59:35 +0430
Lee Harr <missive@hotmail.com> wrote:

>
> Hi;
>
> I'm looking for a way to do this:

> # select idn, magic() as codes FROM tbl;
>  idn | codes
> -----+------
>    1 | A
>    2 | B, C
>    3 | A, C, E
> (3 rows)
>
>
> Right now, I use plpgsql functions, but each time I do it
> I have to rewrite the function to customize it.
>
> Is there a generic way to do this? An aggregate maybe?

array_accum
http://www.postgresql.org/docs/8.2/static/xaggr.html
?


--
Ivan Sergio Borgonovo
http://www.webthatworks.it


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

Предыдущее
От: John Cheng
Дата:
Сообщение: Re: Problem search on text arrays, using the overlaps (&&) operator
Следующее
От: Paul Ramsey
Дата:
Сообщение: Re: Out of memory error