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

--从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

相关文章:

  • 2022-12-23
  • 2021-07-03
  • 2021-04-25
  • 2021-05-14
  • 2021-11-04
  • 2022-12-23
  • 2021-06-06
  • 2021-12-11
猜你喜欢
  • 2022-02-08
  • 2021-11-14
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-12
  • 2021-06-29
相关资源
相似解决方案