Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Mailing Lists -> Oracle-L -> RE: SQL Help, Please!
A running total.......
Here's a useful sample emailed a while ago by Hakan
>
> 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
![]() |
![]() |