Search Postgresql Archives

Re: combine multiple row values in to one row

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 7 Jul 2009 01:59:35 +0430
Lee Harr <missive@xxxxxxxxxxx> 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


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux