Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: Cummulation ?
Using a table named tmpa with the following values:
K VAL
- ----------
A 1 B 2 C 3 D 10 E 20
Use the following query:
select b.key, sum(a.val)
from tmpa a, tmpa b
where a.key <= b.key
group by b.key
to produce:
K SUM(A.VAL)
- ----------
A 1 B 3 C 6 D 16 E 36
hth
Chris
Nicolas Bronke wrote:
> Is it possible to create a sql statement, to cummulate a column?
>
> E.g.
>
> Table has following entries:
>
> A 1000
> B 2000
> C 3000
>
> The result of the sql should be
>
> A 1000
> B 3000
> C 6000
>
> --
> Viele Grüße
> Nicolas Bronke
Received on Tue Mar 09 1999 - 13:39:23 CST
![]() |
![]() |