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