X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 4974FD1B4FF for ; Sat, 4 Oct 2003 09:57:39 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 74108-03 for ; Sat, 4 Oct 2003 06:56:51 -0300 (ADT) Received: from mail.iinet.net.au (mail-14.iinet.net.au [203.59.3.46]) by svr1.postgresql.org (Postfix) with SMTP id A5896D1B540 for ; Sat, 4 Oct 2003 06:56:47 -0300 (ADT) Received: (qmail 20190 invoked from network); 4 Oct 2003 09:56:48 -0000 Received: from unknown (HELO familyhealth.com.au) (203.59.199.78) by mail.iinet.net.au with SMTP; 4 Oct 2003 09:56:46 -0000 Message-ID: <3F7E9956.30804@familyhealth.com.au> Date: Sat, 04 Oct 2003 17:56:38 +0800 From: Christopher Kings-Lynne User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.5b) Gecko/20030901 Thunderbird/0.2 X-Accept-Language: en-us, en MIME-Version: 1.0 To: pgsql-sql@postgresql.org Subject: Running tally Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200310/121 X-Sequence-Number: 15521 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