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

Home -> Community -> Mailing Lists -> Oracle-L -> RE: SQL Help, Please!

RE: SQL Help, Please!

From: Norwood Bradly A <Bradley.A.Norwood_at_M1.IRSCOUNSEL.TREAS.GOV>
Date: Fri, 26 May 2000 12:13:53 -0400
Message-Id: <10509.106892@fatcity.com>


A running total.......  

Here's a useful sample emailed a while ago by Hakan



Subject: Re: Running Totals !!!

>

> hi,

>

> select

> iki.a,max(bir.no),sum(bir.no)

> from

> (select rownum r,xxx.* from xxx) bir,

> (select rownum r,xxx.* from xxx) iki

> where bir.r<=iki.r

> group by iki.a

>

> have a good day.

> =====================================

> Hakan Yuksel, Oracle DBA

> TekstilBank - Istanbul, TURKEY

> email:hyuksel_at_tekstilbank.com.tr

> http://members.xoom.com/hakan_yuksel/

> =====================================

>
 

-----Original Message-----
From: Jane Gao [mailto:JGao_at_kalgold.com.au] Sent: Thursday, May 25, 2000 7:58 PM
To: Multiple recipients of list ORACLE-L Subject: SQL Help, Please!

Hi, Gurus, Could anyone help me with this problem(we are running on Oracle 7.3.4):

I have a table with the following fields and data:

DateOP Tons
------------ -------------

01/05/2000      4.5 
02/05/2000      3.5 
03/05/2000      2 
04/05/2000      4 

I want to write a single SQL to achieve accumulated 'Tons' results like this:

DateOP ACC_Tons
------------ -------------

01/05/2000      4.5 
02/05/2000      8 
03/05/2000      10 
04/05/2000      14 

Thanks in advance.
Jane Gao
Senior Application Support Analyst
Kalgoorlie Consolidated Gold Mines


Received on Fri May 26 2000 - 11:13:53 CDT

Original text of this message

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