Received: from mailin3.email.bigpond.com (juicer24.bigpond.com [139.134.6.34]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6B5Tia24729 for ; Wed, 11 Jul 2001 01:29:45 -0400 (EDT) (envelope-from david@netventures.com.au) Received: from runt.in.netventures.com.au ([139.134.4.57]) by mailin3.email.bigpond.com (Netscape Messaging Server 4.15) with SMTP id GGANJ300.H0V for ; Wed, 11 Jul 2001 15:35:27 +1000 Received: from KTPP-p-203-54-3-146.prem.tmns.net.au ([203.54.3.146]) by mail2.bigpond.com(MailRouter V2.9g 3/6572110); 11 Jul 2001 15:29:37 Received: from ciderbox.in.netventures.com.au ([192.168.10.19] helo=localhost) by runt.in.netventures.com.au with esmtp (Exim 3.03 #1 (Debian)) id 15KD3X-0004lz-00 for ; Wed, 11 Jul 2001 16:01:03 +1000 Date: Wed, 11 Jul 2001 15:30:29 +1000 Content-Type: text/plain; format=flowed; charset=us-ascii Mime-Version: 1.0 (Apple Message framework v388) From: David Stanaway To: pgsql-sql@postgresql.org X-Mailer: Apple Mail (2.388) Content-Transfer-Encoding: 7bit Subject: cumulative sum in aggregate query. Message-Id: X-Archive-Number: 200107/136 X-Sequence-Number: 3928 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 ========================'---------------------------------------------