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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Ranking based on an Indicator

user517674Nov 25 2008 — edited Nov 25 2008
This is how my input data looks like:

Date Indicator

10/01/2008 03:00:00 AM 0
10/01/2008 06:00:00 AM 1
10/01/2008 07:00:00 AM 0
10/01/2008 08:00:00 AM 1
11/01/2008 03:00:00 AM 1
11/01/2008 06:00:00 AM 1
11/01/2008 07:00:00 AM 0
11/01/2008 08:00:00 AM 1


Output I want is:

Date Rank
10/01/2008 03:00:00 AM 1
10/01/2008 06:00:00 AM 2
10/01/2008 07:00:00 AM 3
10/01/2008 08:00:00 AM 4
11/01/2008 03:00:00 AM null
11/01/2008 06:00:00 AM null
11/01/2008 07:00:00 AM 1
11/01/2008 08:00:00 AM 2

What I want to do is start ranking depending on the day & time and when the indicator is zero. In the 10/01 example my value in the first indicator field is 0 and so I start ranking right away, but in the 11/01 example my 3rd row has the value of 0 so my first 2 rows will have no rank.

Thank you..
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 23 2008
Added on Nov 25 2008
5 comments
1,060 views