--递归获取所有子节点 with temp as ( select * from MK_Base_Department where F_DepartmentId='5f258320-c1b7-42a4-b2fe-cafbd7a190ba' union all select a.* from MK_Base_Department a,temp b where a.F_ParentId=b.F_DepartmentId ) select * from temp