– 查询id26一起研发中心及其所有子级部门
go
with temp as(
select * from HrmDepartment where id=‘26’
union all
select c.* from HrmDepartment c ,temp t where c.supdepid=t.id )
select * from temp
sql查询某个部门及其所以子部门信息
最新推荐文章于 2024-06-28 22:56:17 发布
– 查询id26一起研发中心及其所有子级部门
go
with temp as(
select * from HrmDepartment where id=‘26’
union all
select c.* from HrmDepartment c ,temp t where c.supdepid=t.id )
select * from temp