X-Original-To: pgsql-sql@postgresql.org Received: from serwer.skawsoft.com.pl (serwer.skawsoft.com.pl [213.25.37.66]) by postgresql.org (Postfix) with ESMTP id A1404474E53 for ; Mon, 17 Mar 2003 04:15:43 -0500 (EST) Received: from klaster.net (ph139.krakow.cvx.ppp.tpnet.pl [217.99.208.139]) by serwer.skawsoft.com.pl (Postfix) with ESMTP id 063DB6A1DE; Mon, 17 Mar 2003 10:15:08 +0100 (CET) Message-ID: <3E75925A.5000907@klaster.net> Date: Mon, 17 Mar 2003 10:16:10 +0100 From: Tomasz Myrta User-Agent: Mozilla/5.0 (Windows; U; Win 9x 4.90; PL; rv:1.1) Gecko/20020826 X-Accept-Language: pl, en-us, en MIME-Version: 1.0 To: Objectz Cc: pgsql-sql@postgresql.org Subject: Re: String aggregate function References: <000301c2ec5b$6380ce00$aea067d4@eg1opwxp107> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Archive-Number: 200303/383 X-Sequence-Number: 12422 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