Received: from zenon.apartia.com (APoncelet-101-2-1-171.abo.wanadoo.fr [193.251.42.171]) by postgresql.org (8.11.3/8.11.4) with ESMTP id fBJGBUm91663 for ; Wed, 19 Dec 2001 11:11:32 -0500 (EST) (envelope-from vindex@apartia.org) Received: by zenon.apartia.com (Postfix, from userid 1000) id BB7F482A00; Wed, 19 Dec 2001 17:11:28 +0100 (CET) Date: Wed, 19 Dec 2001 17:11:28 +0100 From: Louis-David Mitterrand To: pgsql-sql@postgresql.org Subject: return a text agreggate from a subselect Message-ID: <20011219161128.GB28569@apartia.org> Mail-Followup-To: pgsql-sql@postgresql.org Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.3.24i X-Archive-Number: 200112/207 X-Sequence-Number: 6030 Hi, I am trying to convert a subselect that has several matches into one string comprising all matches concatenated: The subselect: (SELECT company_name FROM table) The output I'd like: 'Company1|Company2|Company3|etc.' Should I write a function or a new agreggate for this or is there is simpler way? Thanks in advance, -- PANOPE: On dit même qu'au trône une brigue insolente Veut placer Aricie et le sang de Pallante. (Phèdre, J-B Racine, acte 1, scène 4)