Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: A typical query
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
![]() |
![]() |