SQL to find the manager and their direct reportees

select papf_Reportee.person_number,
to_char(pasf.EFFECTIVE_START_DATE,'yyyy/dd/mm') start_dt_spr
from per_all_people_f papf,
per_All_assignments_m paam,
PER_ASSIGNMENT_SUPERVISORS_F pasf,
per_all_people_F papf_reportee
where papf.person_id = paam.person_id
and paam.assignment_id = pasf.MANAGER_ASSIGNMENT_ID
and papf.person_number = '90035914' -- supervisor number
and sysdate between trunc(papf.effective_start_Date) and trunc(papf.effective_End_Date)
and sysdate between trunc(paam.effective_start_Date) and trunc(paam.effective_End_Date)
and papf_Reportee.person_id = pasf.PERSON_ID
and sysdate between trunc(papf_Reportee.effective_start_Date) and trunc(papf_Reportee.effective_End_Date)

I hope this blog post was helpful for you. If you have any questions or feedback, please leave a comment below.