Re: Joining several rows into only one

From: "David Johnston" <polobo(at)yahoo(dot)com>
To: "'Oliver d'Azevedo Cristina'" <oliveiros(dot)cristina(at)gmail(dot)com>, "'JORGE MALDONADO'" <jorgemal1960(at)gmail(dot)com>
Cc: <pgsql-sql(at)postgresql(dot)org>
Subject: Re: Joining several rows into only one
Date: 2012-11-28 18:52:27
Message-ID: 00df01cdcd99$83d18850$8b7498f0$@yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

> -----Original Message-----
> From: pgsql-sql-owner(at)postgresql(dot)org [mailto:pgsql-sql-
> owner(at)postgresql(dot)org] On Behalf Of Oliver d'Azevedo Cristina
> Sent: Wednesday, November 28, 2012 1:42 PM
> To: JORGE MALDONADO
> Cc: pgsql-sql(at)postgresql(dot)org
> Subject: Re: [SQL] Joining several rows into only one
>
> You need to use the array_agg() and array_to_string() functions.
>

Or you can skip directly to the "string_agg(expression, delimiter)" function.

See http://www.postgresql.org/docs/9.2/interactive/functions-aggregate.html for more information on aggregate-related functions.

David J.

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Seb 2012-11-29 03:21:32 \copy multiline
Previous Message Oliver d'Azevedo Cristina 2012-11-28 18:42:27 Re: Joining several rows into only one