oracle树形结构遍历

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了oracle树形结构遍历相关的知识,希望对你有一定的参考价值。

数据库树形结构,正反遍历

--从Root往树末梢递归
select level ,identity,pid from table_name
  start with identity=475
  connect by prior identity = pid


--从末梢往树ROOT递归
select level ,identity,pid,yylevel from table_name
  start with identity=542
  connect by prior pid = identity

以上是关于oracle树形结构遍历的主要内容,如果未能解决你的问题,请参考以下文章