X-Original-To: pgsql-sql@postgresql.org Received: from smtp014.mail.yahoo.com (smtp014.mail.yahoo.com [216.136.173.58]) by postgresql.org (Postfix) with SMTP id DDED9474E53 for ; Mon, 17 Mar 2003 03:01:33 -0500 (EST) Received: from unknown (HELO eg1opwxp107) (heshamgowaily@212.103.160.174 with login) by smtp.mail.vip.sc5.yahoo.com with SMTP; 17 Mar 2003 08:01:33 -0000 From: "Objectz" To: Subject: String aggregate function Date: Mon, 17 Mar 2003 10:01:10 +0200 Message-ID: <000301c2ec5b$6380ce00$aea067d4@eg1opwxp107> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.2616 Importance: Normal In-Reply-To: <200303141552.38325.a.schmitz@cityweb.de> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1106 X-Archive-Number: 200303/378 X-Sequence-Number: 12417 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