Oracle Analytic Function - Suggestion/Tips needed

From: <Christopher.Taylor2_at_parallon.net>
Date: Thu, 18 Oct 2012 06:44:39 -0500
Message-ID: <F05D8DF1FB25F44085DB74CB916678E88562E48137_at_NADCWPMSGCMS10.hca.corpad.net>



Version 10.2.0.4

I've been going round and round with this.

Here's a sample of my data and what I need out of it.

NAME....DETAILED_NAME....START_DATE________.....END_DATE_________
A.......Aaaaaaaaaaaaa....10/17/12 00:00:00......10/17/12 00:00:05
B.......Bbbbbbbbbbbb1....10/17/12 00:00:06......10/17/12 00:00:10
B.......Bbbbbbbbbbbb2....10/17/12 00:00:06......10/17/12 00:00:15
B.......Bbbbbbbbbbbb3....10/17/12 00:00:06......10/17/12 00:00:12
C.......Cccccccccccc1....10/17/12 00:00:16......10/17/12 00:00:20
B.......Bbbbbbbbbbbb1....10/17/12 00:00:21......10/17/12 00:00:30
B.......Bbbbbbbbbbbb2....10/17/12 00:00:21......10/17/12 00:00:30
B.......Bbbbbbbbbbbb3....10/17/12 00:00:21......10/17/12 00:00:28
D.......Dddddddddddd1....10/17/12 00:00:31......10/17/12 00:00:40

I need to be able to number (rank) the As,Bs,Cs,Ds having the rank start over for each group that appears more than once so that it looks like this:

NAME....RANK
A.........1.
B.........1.
B.........2.
B.........3.
C.........1.
B.........1.
B.........2.
B.........3.
D.........1.

Basically I need the RANK to start over at 1 for the 4th B and I cannot get my partitioning to work out right.

Any thoughts?

Chris

--
http://www.freelists.org/webpage/oracle-l
Received on Thu Oct 18 2012 - 13:44:39 CEST

Original text of this message