start with connect by prior 递归查询用法
表中数据如下:
转换成树状结构如下:
查询7往上的父节点
select * from 表名 start with no=’7’ connect by prior id=no;
查询7以下的子节点
select * from 表名 start with id=’7’ connect by id= prior no
表中数据如下:
转换成树状结构如下:
查询7往上的父节点
select * from 表名 start with no=’7’ connect by prior id=no;
查询7以下的子节点
select * from 表名 start with id=’7’ connect by id= prior no