主键:OrganizeId 父级Id:ParentId 查询父Id(db063c8c-3c4b-435b-82ca-c951f7302c3d)下所有子级记录
with cte
as
(
select * from Base_Organize
where ParentId
='db063c8c-3c4b-435b-82ca-c951f7302c3d'
union all
select a
.* from Base_Organize a
join cte b
on a
.ParentId
=b
.OrganizeId
)
select * from cte
转载请注明原文地址: https://win8.8miu.com/read-21085.html