查询部门下的所有下级部门

it2022-05-09  28

with Dept as( select id,departmentname,supdepid from hrmdepartment where id='19' union all select HrmDept.id,HrmDept.departmentname,HrmDept.supdepid from hrmdepartment HrmDept,Dept -- 当前部门所有下级 where HrmDept.supdepid=Dept.id -- 当前部门所有上级 where T.supdepid=D.id ) select * from Dept

 


最新回复(0)