Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Cumulative COUNT

simion ursache - oracleJan 23 2009 — edited Jan 23 2009
Hi there,

Does anyone know how can i achieve a cumulative count ?

For example, i have the following select :

select deptno from scott.emp

20
30
30
40
20
10

what i would like to obtain is the following :

deptno count

20 1
30 2
30 2
40 3
20 3
10 4

I'm messing my mind with analithycal funtions, but no result so far.

Do you have a hint ?

Thank you in advance !

Edited by: user817006 on Jan 23, 2009 6:15 AM
This post has been answered by BluShadow on Jan 23 2009
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 20 2009
Added on Jan 23 2009
14 comments
4,815 views