select * from uc_staff_department_level t,uc_t_staff stwhere st.id=t.staff_idand t.department_id in (select d.id from uc_t_department d start with d.id=507055 connect by nocycle d.id = prior d.parent_dep_id)