Running tally

From: Christopher Kings-Lynne <chriskl(at)familyhealth(dot)com(dot)au>
To: pgsql-sql(at)postgresql(dot)org
Subject: Running tally
Date: 2003-10-04 09:56:38
Message-ID: 3F7E9956.30804@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message ow 2003-10-06 00:29:59 FK Constraints, indexes and performance
Previous Message Doris Bernloehr 2003-10-04 00:50:14 Re: Regarding decode function