首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > 其他数据库 >

oracle 正向递归跟反向递归查询

2012-08-25 
oracle正向递归和反向递归查询--正向递归查询(根据id查询自己和自己一下的数据)select * from table start

oracle 正向递归和反向递归查询
--正向递归查询(根据id查询自己和自己一下的数据)

select * from table start with id=9842connect by prior id= parentIdorder by id
--反向递归查询(根据叶子ID查出自己和自己之上的根数据)
select * from tablestart with id=9842connect by nocycle prior parentId=idorder by id

热点排行