Re: String aggregate function - Mailing list pgsql-sql

From Tomasz Myrta
Subject Re: String aggregate function
Date
Msg-id 3E75925A.5000907@klaster.net
Whole thread Raw
In response to String aggregate function  ("Objectz" <objectz@postmark.net>)
Responses Re: String aggregate function  ("Objectz" <objectz@postmark.net>)
List 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




pgsql-sql by date:

Previous
From: Christoph Haller
Date:
Subject: Re: How to compare dates?
Next
From: Achilleus Mantzios
Date:
Subject: Re: How to compare dates?