Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Accumulated SUM in SQL
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>...Received on Sat Mar 10 2001 - 11:19:46 CST
>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
![]() |
![]() |