Re: String aggregate function

From: Tomasz Myrta <jasiek(at)klaster(dot)net>
To: Objectz <objectz(at)postmark(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: String aggregate function
Date: 2003-03-17 09:16:10
Message-ID: 3E75925A.5000907@klaster.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Objectz wrote:
> Hi all,
>
> I want to make an aggregate function that concatenates strings from a
> certain column into one cell in a group by clause.
> For example I have the following table :
>
> Type Text
> =================
> 1 text1
> 2 text2
> 1 text3
> 3 text4
> 2 text5
>
> I need a query that group by type and concats the text columns to
> produce something like the following :
>
> 1 text1, text3
> 2 text2, text5
> 3 text4
>
> I am aware that this can be done through recursive joins but this is too
> complicated and heavy.
>
> Any suggestions?
>
> Regards
Look at this site (Aggregate Functions):
http://www.brasileiro.net:8080/postgres/cookbook/

Regards,
Tomasz Myrta

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Objectz 2003-03-17 10:35:30 Re: String aggregate function
Previous Message Christoph Haller 2003-03-17 08:58:04 Re: How to compare dates?