Re: Cumulative (Running) Sum

From: hubert depesz lubaczewski <depesz(at)depesz(dot)com>
To: Matt Culbreth <mattculbreth(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Cumulative (Running) Sum
Date: 2008-03-08 20:46:31
Message-ID: 20080308204631.GA1248@depesz.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Fri, Mar 07, 2008 at 06:50:17AM -0800, Matt Culbreth wrote:
> I might have missed this somewhere, but PostgreSQL doesn't presently
> support the cumulative/running aggregate function SUM() OVER
> (PARTITION BY) syntax that Oracle does, right?

you might find this useful:
http://www.depesz.com/index.php/2007/08/17/rownum-anyone-cumulative-sum-in-one-query/

please also read comments.

depesz

--
quicksil1er: "postgres is excellent, but like any DB it requires a
highly paid DBA. here's my CV!" :)
http://www.depesz.com/ - blog dla ciebie (i moje CV)

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dave Page 2008-03-08 20:57:28 Re: Watch your PlanetPostgreSQL.org blogs
Previous Message Tom Lane 2008-03-08 20:39:32 Re: Watch your PlanetPostgreSQL.org blogs