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: Accumulated SUM in SQL

Re: Accumulated SUM in SQL

From: Jonathan Lewis <jonathan_at_jlcomp.demon.co.uk>
Date: Sat, 10 Mar 2001 17:19:46 -0000
Message-ID: <984244913.26272.0.nnrp-07.9e984b29@news.demon.co.uk>

Correction -
that should be

    > rows unbounded preceding

--
Jonathan Lewis
Yet another Oracle-related web site:  http://www.jlcomp.demon.co.uk

Practical Oracle 8i:  Building Efficient Databases
Publishers:  Addison-Wesley

Reviews at: http://www.jlcomp.demon.co.uk/book_rev.html



Jonathan Lewis wrote in message
<984043178.17395.0.nnrp-02.9e984b29_at_news.demon.co.uk>...

>It helps if you state Oracle versions.
>
>Under 8.1.6 you can do this with the
>analytic version of sum(), something like;
>
>select
> sales,
> sum(sales) over(
> order by sales
> range unbounded preceding
> ) accumulated sales
>from
> salgrade
>;
>
>
>--
>Jonathan Lewis
>Yet another Oracle-related web site: http://www.jlcomp.demon.co.uk
>
>Practical Oracle 8i: Building Efficient Databases
>Publishers: Addison-Wesley
>
>Reviews at: http://www.jlcomp.demon.co.uk/book_rev.html
Received on Sat Mar 10 2001 - 11:19:46 CST

Original text of this message

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