cumulative sum in aggregate query. - Mailing list pgsql-sql

From David Stanaway
Subject cumulative sum in aggregate query.
Date
Msg-id E15KD3X-0004lz-00@runt.in.netventures.com.au
Whole thread Raw
Responses Re: cumulative sum in aggregate query.  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-sql
Hi there,

I have a query that gives me x/y data for a graph, and at the moment, 
the y data is relative.

EG:

x    |  y
1.2    | +1
1.9    | 0
3.4    | +4
5.2    | -2
6.7    | -1
9.3    | 0
11.3    | -1

Now, I want to convert this result into a result like this:
x    |  y
1.2    | 1
1.9    | 1
3.4    | 5
5.2    | 3
6.7    | 2
9.3    | 0
11.3    | 1

Does anyone have any suggestions as to how to do this?



--
Best Regards
David Stanaway
========================.---------------------------------------------
Technology Manager  -  Australia's Premier Internet Broadcasters
david@NetVentures.com.au     Office +612 9357 1699
========================'---------------------------------------------


pgsql-sql by date:

Previous
From: "Robby Slaughter"
Date:
Subject: RE: "Display of specified number of records."
Next
From: "Richard Huxton"
Date:
Subject: Re: Group by date_part