Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2002
    Posts
    4

    Question Unanswered: SQL accumulative Select

    Any Help ...

    I want to make a select on a table retrieving accumulative results, assume we have this table


    YEAR VALUE
    ------ ---------
    1990 100
    1991 150
    1992 200
    1993 250

    and the output i want should look like this


    YEAR VALUE ACCUMULATED
    ------ -------- ------------------
    1990 100 100
    1991 150 250
    1992 200 450
    1993 250 700

    can i do this in a single SQL statment using self-join.

    THANK YOU ALL

  2. #2
    Join Date
    Feb 2001
    Location
    NC, USA
    Posts
    200
    If you're using Oracle 8i, you can use the windowing functions.

    Do a search in the Oracle docs for 'Cumulative Aggregate Example'. There's some great new OLAP functions built in to Oracle these days.

  3. #3
    Join Date
    Apr 2002
    Posts
    4

    Thumbs up Thank you

    Thank you

    i found the example in the "Oracle9i Data Warehousing Guide" on Oracle site.


    THANK YOU

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •