From: Ashish Karalkar <ashish_postgre@yahoo.co.in>
To: A. Kretschmer <andreas.kretschmer@schollglas.com>
To: pgsql-general@postgresql.org
Subject: Re: SQL Query
Date: Wed, 5 Dec 2007 10:47:44 +0000 (GMT)
Message-ID: <33481.2408.qm@web94314.mail.in2.yahoo.com> (raw)
In-Reply-To: <20071205103548.GD24799@a-kretschmer.de>
"A. Kretschmer" <andreas.kretschmer@schollglas.com> wrote: 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
Thanks Andreas for your replay.
But i don't have an option two send argument to the store proc nither do i know how many multiple records are there for a single X. I want result for all rows of table.
I dont thnink that function will give desired output.
any suggestions?
With Regards
Ashish
Andreas
--
Andreas Kretschmer
Kontakt: Heynitz: 035242/47150, D1: 0160/7141639 (mehr: -> Header)
GnuPG-ID: 0x3FFF606C, privat 0x7F4584DA http://wwwkeys.de.pgp.net
---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?
http://archives.postgresql.org/
---------------------------------
Save all your chat conversations. Find them online.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: ashish_postgre@yahoo.co.in, andreas.kretschmer@schollglas.com
Subject: Re: SQL Query
In-Reply-To: <33481.2408.qm@web94314.mail.in2.yahoo.com>
References: <20071205103548.GD24799@a-kretschmer.de> <33481.2408.qm@web94314.mail.in2.yahoo.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox