--查所有上级
select Ts_Dept.* from Ts_Dept,
(select * from ts_dept where DeptID=10001) temp_dept
where temp_dept.FullID like Ts_Dept.FullID +'%'
union
--查所有下级
select Ts_Dept.* from Ts_Dept,
(select * from ts_dept where DeptID=10001) temp_dept
where Ts_Dept.FullID like temp_dept.FullID +'%'
查询部门上下级
最新推荐文章于 2023-08-04 17:25:59 发布