Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id A76919FBA8B for ; Tue, 24 Apr 2007 10:07:06 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-maia, port 10024) with ESMTP id 43840-02 for ; Tue, 24 Apr 2007 10:06:53 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.4 Received: from mail1008.centrum.cz (mail1008.centrum.cz [213.29.7.89]) by postgresql.org (Postfix) with ESMTP id C965D9FBCC6 for ; Tue, 24 Apr 2007 10:06:52 -0300 (ADT) Received: by mail1008.centrum.cz id S10864270AbXDXNGm (ORCPT ); Tue, 24 Apr 2007 15:06:42 +0200 Received: from 85.160.69.40 by mail1008.centrum.cz (Centrum Mail) with HTTP Date: Tue, 24 Apr 2007 15:06:42 +0200 From: "David Flegl" To: X-Mailer: Centrum Mail 1.0 MIME-Version: 1.0 X-Priority: 3 Message-ID: <200704241506.20350@centrum.cz> References: In-Reply-To: Subject: Re: hi Content-Type: text/plain; charset="windows-1250" Content-Transfer-Encoding: 8bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200704/230 X-Sequence-Number: 28230 Hi, try this. It's working... SELECT t1.sno, sum(t2.value) FROM temp as t1, temp as t2 WHERE t1.sno >= t2.sno GROUP BY t1.sno; but not completely. The problem is the this suppose your sno is uniqu. But as I see 3 is not. Anyway it may help you. >I have the data like this in temp table > >SQL> Select sno, value from temp; > >SNO Value > >1 650.00 > >2 850.00 > >3 640.00 > >3 985.00 > >5 987.00 > >9 9864.00 > >7 875.00 > >Now, I want display the result like this... > >SQL> Select sno, value, get_sum(value) as sum from temp; > > SNO Value SUM > >1 650.00 650.00 > >2 850.00 1500.00 --650+850 > >3 640.00 2140.00 --1500+640 > >3 985.00 3125.00 -- 2140+985 > >5 987.00 4112.00 > >9 9864.00 13976.00 > >7 875.00 14851.00 > > > >Any one can tell me query for this .. I don't want any procedure or >function... > > > > > >Thanks & Regards > >Penchal Reddy > > > > > >Information transmitted by this e-mail is proprietary to Infinite Computer Solutions and / or its Customers and is intended for use only by the individual or the entity to which it is addressed, and may contain information that is privileged, confidential or exempt from disclosure under applicable law. If you are not the intended recipient or it appears that this mail has been forwarded to you without proper authority, you are notified that any use or dissemination of this information in any manner is strictly prohibited. In such cases, please notify us immediately at info.in@infics.com and delete this email from your records. >