String aggregate function

From: "Objectz" <objectz(at)postmark(dot)net>
To: <pgsql-sql(at)postgresql(dot)org>
Subject: String aggregate function
Date: 2003-03-17 08:01:10
Message-ID: 000301c2ec5b$6380ce00$aea067d4@eg1opwxp107
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Manfred Koizar 2003-03-17 08:08:42 Re: create index right after create table not working?
Previous Message D.Sanchez 2003-03-16 22:37:55 Re: two dates