pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Wilkinson, Jim <Jim.Wilkinson@cra-arc.gc.ca>
To: Penchalaiah P. <penchalaiahp@infics.com>
To: pgsql-sql@postgresql.org
Subject: Re: hi
Date: Tue, 24 Apr 2007 08:45:13 -0400
Message-ID: <7CCC5BEF5E72394C963E529B54EB4A642A1A10@SD01ITMV12.PROD.NET> (raw)
In-Reply-To: <A70AE049E81A6A40879D5DC0AC8C38C908CD9133@venus.infics.com>

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                           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.
	

view thread (18+ messages)  latest in thread

Message-ID: <7CCC5BEF5E72394C963E529B54EB4A642A1A10@SD01ITMV12.PROD.NET>
Permalink:  ../7CCC5BEF5E72394C963E529B54EB4A642A1A10@SD01ITMV12.PROD.NET/
Also on:    postgresql.org/message-id/7CCC5BEF5E72394C963E529B54EB4A642A1A10@SD01ITMV12.PROD.NET

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: Jim.Wilkinson@cra-arc.gc.ca, penchalaiahp@infics.com
  Subject: Re: hi
  In-Reply-To: <7CCC5BEF5E72394C963E529B54EB4A642A1A10@SD01ITMV12.PROD.NET>

* 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