Query to find Applicant who are hired amd made employees.
SELECT DISTINCT papf.person_id, papf.full_name, pla.location_id,
pla.location_code, ppos.date_start doj,
xxpa.ROWID row_id
FROM per_all_people_f papf,
per_person_type_usages_f pptu_emp,
per_person_type_usages_f pptu_ex_apl,
per_person_types ppt_emp,
per_person_types ppt_ex_apl,
per_periods_of_service ppos
WHERE papf.person_id = pptu_emp.person_id
AND TRUNC (SYSDATE) BETWEEN papf.effective_start_date
AND papf.effective_end_date
AND TRUNC (SYSDATE) BETWEEN pptu_emp.effective_start_date
AND pptu_emp.effective_end_date
AND TRUNC (SYSDATE)
BETWEEN pptu_ex_apl.effective_start_date
AND pptu_ex_apl.effective_end_date
AND ppt_emp.person_type_id = pptu_emp.person_type_id
AND papf.person_id = pptu_ex_apl.person_id
AND ppt_ex_apl.person_type_id =
pptu_ex_apl.person_type_id
AND ppt_emp.system_person_type = 'EMP'
AND ppt_ex_apl.system_person_type = 'EX_APL'
AND papf.person_id = ppos.person_id;
SELECT DISTINCT papf.person_id, papf.full_name, pla.location_id,
pla.location_code, ppos.date_start doj,
xxpa.ROWID row_id
FROM per_all_people_f papf,
per_person_type_usages_f pptu_emp,
per_person_type_usages_f pptu_ex_apl,
per_person_types ppt_emp,
per_person_types ppt_ex_apl,
per_periods_of_service ppos
WHERE papf.person_id = pptu_emp.person_id
AND TRUNC (SYSDATE) BETWEEN papf.effective_start_date
AND papf.effective_end_date
AND TRUNC (SYSDATE) BETWEEN pptu_emp.effective_start_date
AND pptu_emp.effective_end_date
AND TRUNC (SYSDATE)
BETWEEN pptu_ex_apl.effective_start_date
AND pptu_ex_apl.effective_end_date
AND ppt_emp.person_type_id = pptu_emp.person_type_id
AND papf.person_id = pptu_ex_apl.person_id
AND ppt_ex_apl.person_type_id =
pptu_ex_apl.person_type_id
AND ppt_emp.system_person_type = 'EMP'
AND ppt_ex_apl.system_person_type = 'EX_APL'
AND papf.person_id = ppos.person_id;
No comments:
Post a Comment