select dep_id as id ,dep_name as name,super_id as pid,folder from td_department
start with super_id ='01'
connect by prior dep_id = super_id
写了一个语句,但是只能获取部门01下的子部门,如何获取部门及其子部门
...全文
7475打赏收藏
sql语句--获取部门及其部门子部门的id,name,pid
select dep_id as id ,dep_name as name,super_id as pid,folder from td_department start with super_id ='01' connect by prior dep_id = super_id 写了一个语句,但是只能获取部门01下的子部门,如何获取部门及其子部门