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

Home -> Community -> Usenet -> c.d.o.misc -> Re: Cumulative sum in a Select Statement

Re: Cumulative sum in a Select Statement

From: Ranganathan Chakravarthi <ranga_at_shell.one.net>
Date: 1997/03/20
Message-ID: <5gqe6g$f94@news.one.net>#1/1

Bernard Brault (bbcc_at_istar.ca) wrote:
: How can I do a cumulative sum for a given numeric column using the
: SELECT statement. For instance,
:
: values CumulativeSum
: 1 1
: 2 3
: 3 6
: 4 10
:
: Any idea ?
:
: Thanks.
:
: Bernard.
: bbcc_at_istar.ca

SELECTval, (val*(val+1)/2) "Cumulative Sum"   FROM your_table;

Received on Thu Mar 20 1997 - 00:00:00 CST

Original text of this message

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