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: A typical query

Re: A typical query

From: Alexander I. Doroshko <aid_at_grant.kharkov.ua>
Date: 21 Aug 1999 08:23:12 GMT
Message-ID: <01beebad$f7771a40$190114c1@sister.grant.UUCP>


If the records are ordered by sal, and sal is unique,

select sum(t1.sal*count(t2.sal))
 from your_table t1, your_table t2 where   t2.sal>=t1.sal
 group by t2.sal, t1.sal;

But such a need seems very strange.

venkatprakash_at_my-deja.com wrote in article <7pk30n$37f$1_at_nnrp1.deja.com>...
: I have a typical problem to solve.
:
: IMPORTANT: I need to write a single SQL statement to solve the below
: problsm:
:
: Finding the cumulative value of n records. For eg
:
: sal
: ===
: 10
: 20
: 30
:
: The answer should be 10+(10+20)+(10+20+30)+...
:
: Can anybody give me a tip, please.
Received on Sat Aug 21 1999 - 03:23:12 CDT

Original text of this message

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