Friday, January 30, 2015

Query To get List of Employees which has Supervisors

SELECT ppf.full_name emp_name
      ,ppf1.full_name supervisor_name
FROM per_all_people_f ppf
,per_all_assignments_f paaf
,per_all_people_f ppf1
WHERE 1=1
AND ppf.person_id=paaf.person_id
AND ppf.employee_number IS NOT NULL
AND sysdate BETWEEN paaf.effective_start_date AND paaf.effective_end_date
AND paaf.supervisor_id=ppf1.person_id
ORDER BY 1