Skip site navigation (1) Skip section navigation (2)

Peripheral Links

Header And Logo

PostgreSQL
| The world's most advanced open source database.

Site Navigation

Search archives
  Advanced Search

Re: How fetch multiple rows into one text-field?


  • From: Joshua Tolley <eggyknap(at)gmail(dot)com>
  • To: Andreas <maps(dot)on(at)gmx(dot)net>
  • Cc: pgsql-sql(at)postgresql(dot)org
  • Subject: Re: How fetch multiple rows into one text-field?
  • Date: Fri, 31 Jul 2009 17:29:35 -0600
  • Message-id: <20090731232935.GZ4385@eddie> <text/plain>

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

Attachment: signature.asc
Description: Digital signature



Home | Main Index | Thread Index

Privacy Policy | About PostgreSQL
Copyright © 1996 – 2012 PostgreSQL Global Development Group