Re: sql help to find next record of same status

From: Michel Cadot <micadot{at}altern{dot}org>
Date: Tue, 14 Feb 2006 07:21:09 +0100
Message-ID: <43f176d3$0$647$636a55ce_at_news.free.fr>


<jeffchirco_at_gmail.com> a écrit dans le message de news: 1139868051.176497.82580_at_o13g2000cwo.googlegroups.com...
| Ok, I have a table as described that is a list of employee's status.
| Whether it is "A" for Active, "T" for terminated, or "L" for being on
| leave and the date they went on that status.
| empno number(10),
| eff_date date,
| status varchar2(1)
|
| I need to find all the records where an employee went from status "A"
| to status "A" again (they were not terminated or on leave between their
| two active status). Don't know how this could have happend, but we
| just need to make sure it has not.
| How can I write a SQL statment to do this. I'm lost. Thanks.
|
| Jeff
|

Have a look at the LEAD analytic function:

http://download-west.oracle.com/docs/cd/B10501_01/server.920/a96540/functions60a.htm#83836

Regards
Michel Cadot Received on Tue Feb 14 2006 - 07:21:09 CET

Original text of this message