Categories
- All Categories
- 70 Oracle Analytics News
- 7 Oracle Analytics Videos
- 13.9K Oracle Analytics Forums
- 5.2K Oracle Analytics Idea Labs
- Oracle Analytics User Groups
- 38 Oracle Analytics Trainings
- 56 Oracle Analytics Data Visualizations
- 2 Oracle Analytics Data Visualizations Challenge
- 2 Oracle Analytics Career
- 4 Oracle Analytics Industry
- Find Partners
- For Partners
Welcome to the Oracle Analytics Community: Please complete your User Profile and upload your Profile Picture
Fetching last manager name and number for the terminated employees in sql
Nirmal Kumar L
Rank 3 - Community Apprentice
Summary
Fetching last manager name and number for the terminated employees in sql
Content
Hi,
Anyone know how to fetch the manager name for the terminated employees? For terminated or resigned employees manager name and number wont be there in application. But our customer requirement is to fetch the manager details for them. They want to capture his/her manager name before he resigned. How to fetch that in sql?
Thanks in advance. Need your inputs.
Nirmal kumar
0
Answers
-
select distinct per.person_number ter_person_number,pos.actual_termination_date ter_actual_termination_date,s.manager_id ter_manager_id,mgr_num.person_number ter_manager_number,per.person_id ter_person_id,mgr_name.DISPLAY_NAME ter_manager_name,mgr_adid.attribute3 ter_mgr_adidfrom per_periods_of_service pos, per_assignment_supervisors_f s, per_all_people_f mgr_num, per_all_people_f per, PER_PERSON_NAMES_F mgr_name, per_persons mgr_adidwhere pos.actual_termination_date is not nulland pos.person_id = s.person_idand pos.actual_termination_date between s.effective_start_date and s.effective_end_dateand s.manager_id = mgr_num.person_idand s.manager_type = 'LINE_MANAGER'and pos.actual_termination_date between mgr_num.effective_start_date and mgr_num.effective_end_dateand per.person_id = pos.person_idand pos.actual_termination_date between per.effective_start_date and per.effective_end_dateand s.manager_id = mgr_name.person_idAND mgr_adid.person_id = mgr_name.person_id(+)0