with recursive cte(dept_id) as (
select dept_id from co_dept cd where cd.dept_id = '2061'
union all
select cd.dept_id from co_dept cd,cte where cd.parent_id = cte.dept_id
)
select * from cte
MySql 递归获取当前部门所有子级的部门
于 2024-07-12 15:33:09 首次发布