You can use plpythonu (or tcl or C or R) to do running
sums. For plpythonu, you must initialize the SD[]
by calling it first with the proper argument.
create or replace function runsum(int,int)
returns int as
'
if args[0] == 1:
SD["currval"] = 0
return SD["currval"]
else:
On Saturday 04 October 2003 10:56, Christopher Kings-Lynne wrote:
> Hi guys,
>
> If I have a table that is just a single column full of numbers, how can
> I select all the rows from the table with a second column that is the
> running tally so far down the result set?
>
> eg:
>
> Num Tally so f
Hi guys,
If I have a table that is just a single column full of numbers, how can
I select all the rows from the table with a second column that is the
running tally so far down the result set?
eg:
Num Tally so far
0.3 0.3
1.2 1.5
2.0 3.5
...
Does this require PL/PgSQL coding?