Received: from localhost (unknown [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 498F02E037F for ; Wed, 5 Dec 2007 06:35:57 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 02613-03 for ; Wed, 5 Dec 2007 06:35:48 -0400 (AST) Received: from moutng.kundenserver.de (moutng.kundenserver.de [212.227.126.186]) by postgresql.org (Postfix) with ESMTP id E76482E00EA for ; Wed, 5 Dec 2007 06:35:51 -0400 (AST) Received: from webserv.wug.de ([194.25.154.138]) by mrelayeu.kundenserver.de (node=mrelayeu7) with ESMTP (Nemesis) id 0ML2xA-1IzrbZ3HB0-0001mk; Wed, 05 Dec 2007 11:35:50 +0100 Received: from kretschmer by webserv.wug.de with local (Exim 3.36 #1) id 1IzrbY-0000DN-00 for pgsql-general@postgresql.org; Wed, 05 Dec 2007 11:35:48 +0100 Date: Wed, 5 Dec 2007 11:35:48 +0100 From: "A. Kretschmer" To: pgsql-general@postgresql.org Subject: Re: SQL Query Message-ID: <20071205103548.GD24799@a-kretschmer.de> References: <843803.85383.qm@web94301.mail.in2.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <843803.85383.qm@web94301.mail.in2.yahoo.com> X-OS: Debian/GNU Linux - weil ich es mir Wert bin! User-Agent: Mutt/1.5.9i X-Provags-ID: V01U2FsdGVkX18On9N1VMCo9Eiq9t5xW8Mf4yKvWGJs1TVdYdO DIxfsb4Qo3mdpAGfu6+6KUVBdIZhEjPSnCYU2Stdx8ZFcpa3Jx 1MNBdW8TybFDw9SxMnT3a7KJyh4tVww X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200712/241 X-Sequence-Number: 124985 am Wed, dem 05.12.2007, um 10:24:04 +0000 mailte Ashish Karalkar folgendes: > Hello List member, > > Iha a table containing two columns x and y . for single value of x there are > multiple values in y e.g > > X Y > ------------ > 1 ABC > 2 PQR > 3 XYZ > 4 LMN > 1 LMN > 2 XYZ > > I want a query that will give me following output > > 1 ABC:LMN > 2 PQR:XYZ > 3 XYZ > 4 LMN > > Any help will be really helpful You need a new aggregate-function. A solution for a similar problem (but with comma instead :) can you find here: http://www.zigo.dhs.org/postgresql/#comma_aggregate Andreas -- Andreas Kretschmer Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header) GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net