oracle:递归查询

select *
from test
--包括该id及其子节点
connect by prior id = pid start with id = '?'
--包括该id及其父节点
--connect by id = prior pid start with id = '?'
--仅其子节点
--connect by prior id = pid start with pid = '?'
--该节点的每一个直属子节点递归查询子节点(谨慎使用)
--connect by id = prior pid start with pid = '?'
order by id

猜你喜欢

转载自blog.csdn.net/m0_38084243/article/details/84566870