标签:
递归查询所有子节点
SELECT * FROM hrmdepartment
START WITH id=22
CONNECT BY PRIOR id=supdepid
with result_table as
(
select a.id,a.lastname,a.managerid from hrmresource a where id=321
union all
select k.id,k.lastname,k.managerid from hrmresource k inner join result_table c on c.id = k.managerid
)select * from result_table
标签:
原文地址:http://www.cnblogs.com/JsonShare/p/5120585.html