Re: combine multiple row values in to one row - Mailing list pgsql-general

From Ivan Sergio Borgonovo
Subject Re: combine multiple row values in to one row
Date
Msg-id 20090707022235.6bd1e038@dawn.webthatworks.it
Whole thread Raw
In response to combine multiple row values in to one row  (Lee Harr <missive@hotmail.com>)
List 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 by date:

Previous
From: John Cheng
Date:
Subject: Re: Problem search on text arrays, using the overlaps (&&) operator
Next
From: Paul Ramsey
Date:
Subject: Re: Out of memory error