Supervisor Change.Pls help

I have a employee table
person_id employee_number full_name supervisor_name start_date end_date
1           100               Cob     Don             01-JAN-2000   31-DEC-2000
1           100               Cobb    Don             01-JAN-2001   30-JUN-2001
1           100               Cobb     Smith           01-JUL-2001   31-DEC-2001person_id start_date and end_date is composite primary key
I need a output where employee's supervisor changed between two dates
employee_number full_name old_supervisor_name  new_supervisor_name
100               cobb          Don                  SmithPlease let me know if i am not clear

Try this:
WITH employee AS
(SELECT 1 person_id, 100 employee_number, 'Cobb' full_name, 'Don' supervisor_name, TO_DATE('01-JAN-2000') start_date, TO_DATE('31-DEC-2000') end_date FROM dual UNION ALL
SELECT 1 person_id, 100 employee_number, 'Cobb' full_name, 'Don' supervisor_name, TO_DATE('01-JAN-2001') start_date, TO_DATE('30-JUN-2001') end_date FROM dual UNION ALL
SELECT 1 person_id, 100 employee_number, 'Cobb' full_name, 'Smith' supervisor_name, TO_DATE('01-JUL-2001') start_date, TO_DATE('31-DEC-2001') end_date FROM dual UNION ALL
SELECT 2 person_id, 110 employee_number, 'Jones' full_name, 'Mark' supervisor_name, TO_DATE('01-JAN-2000') start_date, TO_DATE('31-DEC-2001') end_date FROM dual)
SELECT employee_number,
       full_name,
       supervisor_name,
       new_supervisor_name
FROM  (SELECT employee_number,
              full_name,
              supervisor_name,
              LEAD(supervisor_name) OVER (PARTITION BY employee_number ORDER BY employee_number, start_date) new_supervisor_name
       FROM   employee)
WHERE  supervisor_name != NVL(new_supervisor_name, supervisor_name)

Similar Messages

  • Mileage Reimbursement rate for car needs to be changed -Pls help!!

    Hello Gurus,
    Currently I am working for european end markets for T&E module.
    Iam facing a problem that:
    I need to change the mileage reimbursement rate has changed for Belgium.
    The mileage rate for Belgium needs to be changed for comp codes (BL01 and BL02) the new rate needs to be 0.2940eur/KM for own car mileage claims.
    Since, i am new to payroll area, can some one pls help me.. where we track such changes? Is it done under payroll?
    Pls advice for same...
    Points assured
    Thanks & regds,
    N.babu

    Hello Karthi,
    I want to change the mileage rate for own cars for Belgium. It is for personnel area BL01 & BL02.
    <b>The new rate has been changed to be 0.2940eur/KM for own car mileage claims.</b>
    This will ensure that employees are being reimbursed the correct amount for their mileage cost when using their own car and travelling for business purposes
    Hence I want to know, is there any settings we need to maintain in payroll?
    Regds,
    N babu

  • Both wi-fi and 3g aren't working for the past 5 days. I have tried all that i thought could be done but to no avail. Its been 4 days now and no any change, pls help

    Please help! Both wi-fi and 3g not working on my iphone 4. I have tried all that i thought to resolve it but to no avail. Its been 5 days now and i can't have internet access, whats the need of have a smart phone with no internet access, really frustrating! pls help.

    It may be a hardware failure, but start here: http://support.apple.com/kb/TS1559
    As hardware failures go, WiFi chip failure is a common one. 3G is completely separate, however.

  • Few system level Changes-Pls Help

    Hello All,
    Can anybody tell me how to make these changes:
    1)Golbally BWD server time needs to be default to EST as of the default to German time.
    (2)Globally User Setup in BW for date and currency format ($ 1,234,567.99 and 20060831)
    3)Maintenance of the permitted extra char in BW.
    We are using NW04 on Windows 2003 server with Oracle 9i as database.
    Please provide me the resolution to the following email id:
    veerarag [email protected]
    Thanks,
    Veeraraghavan.S

    Hello All,
    Can anybody tell me how to make these changes:
    1)Golbally BWD server time needs to be default to EST as of the default to German time.
    (2)Globally User Setup in BW for date and currency format ($ 1,234,567.99 and 20060831)
    3)Maintenance of the permitted extra char in BW.
    We are using NW04 on Windows 2003 server with Oracle 9i as database.
    Please provide me the resolution to the following email id:
    veerarag [email protected]
    Thanks,
    Veeraraghavan.S

  • How to Change the Default SSH Port from Terminal ? now showing default SSH Port 22 i need change it pls help me how can do

    How to Change the Default SSH Port from Terminal ?
    now showing default SSH Port 22 i need change it pls help me how can do

    How to Change the Default SSH Port from Terminal ?
    now showing default SSH Port 22 i need change it pls help me how can do

  • Hi, i installed ios 5 for my iphone 4 and the camera function on lock screen was on the first few days , now it doesn't show the lock screen . is there any change i can do . Pls help me to solve the issue.

    hi, i installed ios 5 for my iphone 4 and the camera function on lock screen was on the first few days , now it doesn't show the lock screen . is there any change i can do . Pls help me to solve the issue.

    nishaadp wrote:
    ... it stucks with the apple logo ,  nothing works. Is anything i can do?
    See Here for
    Frozen or unresponsive iPhone

  • How do I delete my old iMessage email and change to my current one, that Im using when I buy apps and so on. The old one wont go away when I turn iMessage on and of again. pls help

    How do I delete my old iMessage email and change to my current one, that Im using when I buy apps and so on. The old one wont go away when I turn iMessage on and of again. pls help
    Anyone had the same?

    How do I delete my old iMessage email and change to my current one, that Im using when I buy apps and so on. The old one wont go away when I turn iMessage on and of again. pls help
    Anyone had the same?

  • Very  Urgent Pls  help :  Change of  payload type to  user-defined types

    Hello Experts
    I was using sys.xml_type as payload type in my queue table creation.
    consider xml message
    <order>
    <id>1</id>
    <load rerer="mq" erere='gg" > </load>
    </order>
    This i inserted into queue table using enqueue process.
    this is done.
    BUT NOW My manager wants to change the payload type.
    he created a type
    create or replace type systype as object (msg varchar2(4000));
    Now payload type of queue table is changed to
    PayloadType==>aq.systype.
    Pls help me how can i insert xml messages into this queue table.
    This is very urgent. Pls help me
    S

    I've just read this thread three times and I have absolutely no idea what you are doing, in what version, and what you are asking for help with.
    Do you want to change the message type? If you do you MUST drop the queue and start over again from the beginning.
    Do you want to enqueue messages?
    Post your DDL and other relevant information or you are on your own. We can not guess at your issue.

  • HT4098 I just fill in my credit card to purchase in games but always pls contact itune support, i try to but its hard to change my cc data in it,pls help me,tks

    I just fill in my credit card to purchase in games but always pls contact itune support, i try to but its hard to change my cc data in it,pls help me,tks

    When you get the message to contact iTunes support, that is what you have to do. There is nobody here that can help you, as it must be some issue with your account or credit card that only an Apple employee can help you with.
    Do as instructed in the message and contact iTunes Support. You can start here. Change to your own country if needed by tapping on the link in the upper right corner of this website.
    http://www.apple.com/emea/support/itunes/contact.html

  • My calender is in unknown language pls help how to change back to normal language?

    my calender is in unknown language pls help how to change back to normal language?

    I do not know this tool can you be specific, just curious.
    T the Op the easiest way of reseting your preferences is the hold the command option shift keys down as Illustrator launches you have to click on the Illustrator icon and quickly hold these keys down.
    Oh yes on the PCit is control alt shift.

  • I want to change my password but the system is not sending me message to reset my password. pls help someone is using my password without my permission and i want to change my password.

    i want to change my password but the system is not sending me message to reset my password. pls help someone is using my password without my permission and i want to change my password.

    If you are talking about your Apple ID password, make sure it IS your apple ID.
    In the past 24 hours, I have received two emails "How to reset your Apple ID password". I  had not requested any change and I finally realized someone else is trying to reset the password. I have had this Apple ID since 2009 so I am not using someone else's ID.
    Again, if you are not receiving the email to reset make sure you have the right ID - it might be going to the email linked to the account, and it might not be yours.

  • I'm using firefox 6.0.2 It's making problem with Bangla font ONLY on FACEBOOK others bangli website FORNT SIZE are OK. On the FACEBOOK it shows Bangla font in a very / Too small! I change font SIZE in firefox setting but i can't solve. Pls HELP me

    I'm using firefox 6.0.2 It's making problem with Bangla font ONLY on FACEBOOK others bangli website FORNT SIZE are OK. On the FACEBOOK it shows Bangla font in a very / Too small! I change font SIZE in firefox setting but i can't solve. Pls HELP me ..

    Reset the page zoom on pages that cause problems: <b>View > Zoom > Reset</b> (Ctrl+0 (zero); Cmd+0 on Mac)
    *http://kb.mozillazine.org/Zoom_text_of_web_pages
    You can use an extension to set a default font size and page zoom on web pages.
    *Default FullZoom Level: https://addons.mozilla.org/firefox/addon/default-fullzoom-level/
    *NoSquint: https://addons.mozilla.org/firefox/addon/nosquint/

  • Error in change Number ..pls Help Me..urjent

    <b>Hi all..
    when i run a transaaction ( Zasd) in PRD with change number 11784  the report works fine. But when i enter
    change number 11929 . iwill get error change order not found. but  when i use CC03 transactoin with this change number i saw the details for this number..
    pls suggest me what i do..i think  report is ok.is it right ????  what i do..pls help me..
    thanks in advance...
    the selection sereen is below....
    PARAMETERS: p_chgnr TYPE aennr.
    PARAMETERS: p_width TYPE int4 DEFAULT cv_maxmodels.
    PARAMETERS: p_anego TYPE c AS CHECKBOX DEFAULT co_true.
    get all engineering change details
      CREATE OBJECT go_engchange EXPORTING changeorder = p_chgnr.</b>

    Hello Papai
    In order to track down the problem I would suggest two things you should check with change number 11929:
    (1) Does your report actually pass the CREATE OBJECT statement or do the other select-parameters prevent that this change number is found?
    (2) If the class used for go_engchange can be publicly instantiated, then call the class builder (SE24) with the class and test it. In test mode you can create an instance using your change number as input.
    (3) If instantiation fails then repeat it in debugging mode. Sooner or later you must find the error source.
    Regards
      Uwe

  • I have an ipad3 in India, I am unable to make purchases in AppStore as I am unable to change country details in credit card . Pls help how to do that?

    Pls help I am unable to purchase from AppStore for ipad3 in India. I am unable to change country details in the credit card info while purchasing.

    If you still have problem, you can contact iTune Support
    http://www.apple.com/emea/support/itunes/contact.html

  • When i type my email, the text would go on and on and overflows. I mean to say it doesn't autmatically hit the right hand side wall and change to next line! I have to manually press enter and then next line starts. Started happening suddenly.pls help.

    When i type my email, the text would go on and on and overflows. I mean to say it doesn't autmatically hit the right hand side wall and change to next line! I have to manually press enter and then next line starts. Started happening suddenly.pls help.

    Does it happen when you reply to an email? If so, it might be that there's content in the original email (like an image or something similar) that overflows the window content, therefore the Mail app, when you hit the border, follows the content below instead of going on a new line. You might wanna try that.
    Also: Please do not post the whole question in the question title.

Maybe you are looking for