|Date:||Fri, 25 Jul 2008|
I want to see if I can create a slick query to do this and cut down on
I have a list of dates & statuses like this:
I'll order them in the query. What I need to do is first check to see
if there is a status of Active or Pending and return the first one I
encounter. If those do not exist, I need to return the first Complete
or Cancelled I encounter.
In this case Active would be returned.
Right now I have a cursor and some PL/SQL going through 2 loops
checking for Active/Pending, then Complete/Cancelled. I'd like to see
if I can do it all in one query.
Any hopes of doing this?