Running tally - Mailing list pgsql-sql

From Christopher Kings-Lynne
Subject Running tally
Date
Msg-id 3F7E9956.30804@familyhealth.com.au
Whole thread Raw
Responses Re: Running tally  (Richard Huxton <dev@archonet.com>)
Re: Running tally  (elein <elein@varlena.com>)
List pgsql-sql
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?  If so, how do you actually construct 
an arbitrary row for returning?  The docs are somewhat unclear on this.

Chris




pgsql-sql by date:

Previous
From: Richard Huxton
Date:
Subject: Re: sql performance and cache
Next
From: Richard Huxton
Date:
Subject: Re: Running tally