Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.tools -> Cumulative query

Cumulative query

From: <ruudbax_at_my-deja.com>
Date: Wed, 16 Aug 2000 09:21:59 GMT
Message-ID: <8ndmfc$6db$1@nnrp1.deja.com>

I'm trying to write a cumulative query on a table that looks like this.

createdate, itemid

If the table would be filled with the following data:

01-01-2000  1
01-01-2000  2
01-01-2000  3
02-01-2000  4
02-01-2000  5
03-01-2000  6
04-01-2000  7
04-01-2000  8

With the simple query by day (select count(*) from table group by createdate) I would get the number of items created on every date.

I would however like to have a cumulative result, so:

Date Number of items

01-01-2000  3
02-01-2000  5   <3+2>
03-01-2000  6   <3+2+1>
04-01-2000  8   <3+2+1+2>




Sent via Deja.com http://www.deja.com/
Before you buy. Received on Wed Aug 16 2000 - 04:21:59 CDT

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US