sql 递归查询,查出所有子节点

with t as
(
  select b.* from Base_Department b where ParentId = 'cce4152c-3483-4334-b68d-155da627bca0' 
  union all
  select a.* from Base_Department a join t b on a.ParentId=b.DepartmentId
)
select * from t

  

原文地址:https://www.cnblogs.com/dongh/p/8710393.html