cumulative sum in aggregate query.

Поиск
Список
Период
Сортировка
От David Stanaway
Тема cumulative sum in aggregate query.
Дата
Msg-id E15KD3X-0004lz-00@runt.in.netventures.com.au
обсуждение исходный текст
Ответы Re: cumulative sum in aggregate query.  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: "Robby Slaughter"
Дата:
Сообщение: RE: "Display of specified number of records."
Следующее
От: "Richard Huxton"
Дата:
Сообщение: Re: Group by date_part