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

Home -> Community -> Usenet -> c.d.o.server -> Re: Running total query.

Re: Running total query.

From: <yong321_at_yahoo.com>
Date: 2000/05/29
Message-ID: <8gsv30$pri$1@nnrp1.deja.com>#1/1

In article <392AEF36.8195423A_at_non.hp.com>,   Michael Rothwell <mike_rothwell_at_non.hp.com> wrote:
> Has anyone come up with an easy solution to get running balances in a
> query?
>
> If I have a table tA that has columns c1 number (pk), c2 number, c3
> number
>
> I would like a query that returns the prime key ( c1 ) , c2, c3, and a
> running total of prior running total + c2 - c3
>
> c1 c2 c3 running total
> ------- -------- --------- ---------------
> 1 500.00 0.00 500.00 ( 500 + 0 = 500
 )
>
> 2 0.00 450.00 50.00 ( 500 + 0 -
 450
> = 50 )
> 3 200.00 150.00 100.00 ( 50 + 200 - 150
 =
> 100 )
>
> Thanks for any input.
>
> Michael
>
>

Look at http://www.dbmsmag.com/9604d06.html. I don't know if this Web page can solve your problem. I didn't read it carefully:

--
Yong Huang

(yong321_at_yahoo.com)
(http://www.stormloader.com/yonghuang/)


Sent via Deja.com http://www.deja.com/
Before you buy.
Received on Mon May 29 2000 - 00:00:00 CDT

Original text of this message

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