String aggregate function - Mailing list pgsql-sql

From Objectz
Subject String aggregate function
Date
Msg-id 000301c2ec5b$6380ce00$aea067d4@eg1opwxp107
Whole thread Raw
In response to Re: Create function statement with insert statement  (Andreas Schmitz <a.schmitz@cityweb.de>)
List pgsql-sql
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




pgsql-sql by date:

Previous
From: Joost Witteveen
Date:
Subject: create index right after create table not working?
Next
From: Manfred Koizar
Date:
Subject: Re: create index right after create table not working?