Received: from localhost (maia-3.hub.org [200.46.204.184]) by postgresql.org (Postfix) with ESMTP id 50D559FBB4E for ; Tue, 24 Apr 2007 09:45:21 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.184]) (amavisd-maia, port 10024) with ESMTP id 33274-09 for ; Tue, 24 Apr 2007 09:45:11 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail103.cra-arc.gc.ca (mail103.cra-arc.gc.ca [198.103.184.26]) by postgresql.org (Postfix) with ESMTP id CFB259FBC2B for ; Tue, 24 Apr 2007 09:45:15 -0300 (ADT) Received: from SD01ITMB02.PROD.NET (unknown [7.32.10.168]) by mail103.cra-arc.gc.ca (mail) with ESMTP id 6F3B588M72; Tue, 24 Apr 2007 08:45:14 -0400 (EDT) Received: from SD01ITMV12.PROD.NET ([7.32.10.12]) by SD01ITMB02.PROD.NET with Microsoft SMTPSVC(6.0.3790.2499); Tue, 24 Apr 2007 08:45:14 -0400 x-mimeole: Produced By Microsoft Exchange V6.5 Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----_=_NextPart_001_01C7866E.671916A3" Subject: Re: hi Date: Tue, 24 Apr 2007 08:45:13 -0400 Message-ID: <7CCC5BEF5E72394C963E529B54EB4A642A1A10@SD01ITMV12.PROD.NET> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [SQL] hi Thread-Index: AceGaVrXzeAnlAhdTMCVI9c6fYHGqAABMMmw From: "Wilkinson, Jim" To: "Penchalaiah P." , X-OriginalArrivalTime: 24 Apr 2007 12:45:14.0372 (UTC) FILETIME=[6776EC40:01C7866E] X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.586 tagged_above=0 required=5 tests=AWL=-1.138, BAYES_05=-1.11, HTML_MESSAGE=0.001, HTML_TEXT_AFTER_BODY=0.115, RCVD_ILLEGAL_IP=0.288, RCVD_IN_WHOIS_BOGONS=2.43 X-Spam-Level: X-Archive-Number: 200704/229 X-Sequence-Number: 28229 This is a multi-part message in MIME format. ------_=_NextPart_001_01C7866E.671916A3 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Select sno AS "SNO", SELECT value AS "VALUE", get_sum(value) as SUM from temp; =20 =20 =20 ________________________________ From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] On Behalf Of Penchalaiah P. Sent: April 24, 2007 8:09 AM To: pgsql-sql@postgresql.org Subject: [SQL] hi=20 =20 Hi=20 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 =20 Any one can tell me query for this .. I don't want any procedure or function... =20 =20 Thanks & Regards Penchal Reddy =20 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. =09 ------_=_NextPart_001_01C7866E.671916A3 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Select sno AS = “SNO”,

SELECT  value AS = “VALUE”,

 get_sum(value) as SUM

 from temp;

 

 

 


From: pgsql-sql-owner@postgresql.org [mailto:pgsql-sql-owner@postgresql.org] = On Behalf Of Penchalaiah P.
Sent: April 24, 2007 8:09 = AM
To: = pgsql-sql@postgresql.org
Subject: [SQL] hi =

 

Hi

I have the data like this in temp table

SQL> Select sno, value from = temp;

SNO     &nb= sp;           &nbs= p;         Value

1     &nb= sp;               = 650.00

2     &nb= sp;               = 850.00

3     &nb= sp;               = 640.00

3     &nb= sp;               = 985.00

5     &nb= sp;               = 987.00

9     &nb= sp;               = 9864.00

7     &nb= sp;               = 875.00

Now, I want display the result like = this…

SQL> Select sno, value, get_sum(value) as sum from = temp;

      =   SNO           &nbs= p;       Value           &n= bsp;  SUM

1     &nb= sp;               650.00           &= nbsp; 650.00

2     &nb= sp;               850.00           &= nbsp; 1500.00           = --650+850

3     &nb= sp;               640.00           &= nbsp; 2140.00           = --1500+640

3     &nb= sp;               985.00           &= nbsp; 3125.00           -- = 2140+985

5     &nb= sp;               987.00           &= nbsp; 4112.00

9     &nb= sp;               9864.00           = 13976.00

7     &nb= sp;               875.00           &= nbsp; 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.
------_=_NextPart_001_01C7866E.671916A3--