Re: How fetch multiple rows into one text-field? - Mailing list pgsql-sql

From Joshua Tolley
Subject Re: How fetch multiple rows into one text-field?
Date
Msg-id 20090731232935.GZ4385@eddie
Whole thread Raw
In response to How fetch multiple rows into one text-field?  (Andreas <maps.on@gmx.net>)
List pgsql-sql
On Fri, Jul 31, 2009 at 10:09:46PM +0200, Andreas wrote:
> Hi,
>
> how can I fetch multiple rows into one text-field?
> I need the contents of some log-infos condensed into a single text to
> show in a report.

It sounds like you might want something like this:

SELECT ... array_to_string(array_accum(log_notes, '<some delimiter>')) FROM...

You might need to add array_accum manually; before 8.4 it wasn't built in.
See http://www.postgresql.org/docs/8.3/static/xaggr.html

--
Joshua Tolley / eggyknap
End Point Corporation
http://www.endpoint.com

pgsql-sql by date:

Previous
From: Andreas
Date:
Subject: How fetch multiple rows into one text-field?
Next
From: Heigo Niilop
Date:
Subject: SELECT max() group by problem