pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Objectz <objectz@postmark.net>
To: pgsql-sql@postgresql.org
Subject: String aggregate function
Date: Mon, 17 Mar 2003 10:01:10 +0200
Message-ID: <000301c2ec5b$6380ce00$aea067d4@eg1opwxp107> (raw)
In-Reply-To: <200303141552.38325.a.schmitz@cityweb.de>

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





view thread (6+ messages)  latest in thread

Message-ID: <000301c2ec5b$6380ce00$aea067d4@eg1opwxp107>
Permalink:  ../000301c2ec5b$6380ce00$aea067d4@eg1opwxp107/
Also on:    postgresql.org/message-id/000301c2ec5b$6380ce00$aea067d4@eg1opwxp107

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: objectz@postmark.net
  Subject: Re: String aggregate function
  In-Reply-To: <000301c2ec5b$6380ce00$aea067d4@eg1opwxp107>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox