X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 04B5F9DCA22 for ; Sat, 11 Mar 2006 12:50:18 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 98016-04 for ; Sat, 11 Mar 2006 12:50:17 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from fep03.ttnet.net.tr (mail.ttnet.net.tr [212.175.13.129]) by postgresql.org (Postfix) with ESMTP id AD39B9DCA4F for ; Sat, 11 Mar 2006 12:50:15 -0400 (AST) Received: from (192.168.8.103) by AVGW-I-1.ttnet.net.tr via smtp id 3265_15f2c69a_b0f5_11da_8a62_001422175f0e; Sat, 11 Mar 2006 13:49:25 +0200 Received: from alamut ([85.96.109.238]) by fep03.ttnet.net.tr with ESMTP id <20060311164553.MASQ12115.fep03.ttnet.net.tr@alamut>; Sat, 11 Mar 2006 18:45:53 +0200 Date: Sat, 11 Mar 2006 18:48:00 +0200 From: Volkan YAZICI To: "Jesper K. Pedersen" Cc: pgsql-sql@postgresql.org Subject: Re: Merging rows into one result? Message-ID: <20060311164800.GA218@alamut> References: <20060311173133.1358a018@io.solnet> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20060311173133.1358a018@io.solnet> User-Agent: Mutt/1.4.2.1i X-NAI-Spam-Rules: 0 Rules triggered X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.887 required=5 tests=[AWL=0.886, UNPARSEABLE_RELAY=0.001, UPPERCASE_25_50=0] X-Spam-Score: 0.887 X-Spam-Level: X-Archive-Number: 200603/165 X-Sequence-Number: 24511 Hi, On Mar 11 05:31, Jesper K. Pedersen wrote: > Is it possible to use SQL to merge data into one result? test=# SELECT id, info FROM concat_t; id | info ----+------ 1 | A 2 | B 1 | AA 3 | C 1 | D 1 | DD (6 rows) test=# SELECT array_to_string(ARRAY(SELECT info FROM concat_t WHERE id = 1), ' '); array_to_string ----------------- A AA D DD (1 row) HTH Regards.