Running Total with a Set Maximum - Mailing list pgsql-general

From Paul Newman
Subject Running Total with a Set Maximum
Date
Msg-id 2796D8B40BBACF42965C54F9AE6969B30180AF@sbs2003.prohire.local
Whole thread Raw
Responses Re: Running Total with a Set Maximum  (Peter Hunsberger <peter.hunsberger@gmail.com>)
List pgsql-general
Hi,
Could someone out there help me.
Given the following set of values
+3
+3
0
+3
+3
-3
0
+3
 
I want to have a maximum sum of 6 at any one point , in other words I want the following
 
 
+3  --  3
+3  --  6
0   --  6
+3  --  6
+3  --  6
-3  --  3
0  -- 3
+3  -- 6
 
How can I do this ?
 
Thank you
 
Paul Newman
 
 

Disclaimer
This message may contain information which is legally privileged and/or confidential.  If you are not the intended recipient, you are hereby notified that any unauthorised disclosure, copying, distribution or use of this information is strictly prohibited.  Such notification not withstanding, any comments or opinions expressed are those of the originator, not of Prohire Software Systems Ltd, unless otherwise explicitly stated.

pgsql-general by date:

Previous
From: Vyacheslav Kalinin
Date:
Subject: Re: Scalar subquery
Next
From: Luka Novak
Date:
Subject: postgreSQL problem