SELECT employee.employee_number,
employee.full_name,
employee.email_address,
paaf.supervisor_id,
supervisor.full_name,
supervisor.email_address
FROM per_all_people_f employee
,per_all_assignments_f paaf
,per_people_x supervisor
WHERE employee.current_employee_flag = 'Y'
AND paaf.supervisor_id(+) = supervisor.person_id
AND TRUNC (SYSDATE) BETWEEN employee.effective_start_date
AND employee.effective_end_date
AND TRUNC (SYSDATE) BETWEEN supervisor.effective_start_date
AND supervisor.effective_end_date
AND employee.person_id = paaf.person_id
AND employee.employee_number IS NOT NULL
--AND employee.employee_number = '1234567890'
AND employee.person_type_id =
(SELECT person_type_id
FROM per_person_types
WHERE user_person_type = 'Employee'
AND business_group_id = employee.business_group_id
)
No comments:
Post a Comment