oracle start with connect by prior 递归查询用法
2017-10-31 14:50
597 查看
start with 子句:遍历起始条件,有个小技巧,如果要查父结点,这里可以用子结点的列,反之亦然。
connect by 子句:连接条件。关键词prior,prior跟父节点列parentid放在一起,就是往父结点方向遍历;prior跟子结点列subid放在一起,则往叶子结点方向遍历,
parentid、subid两列谁放在“=”前都无所谓,关键是prior跟谁在一起。
order by 子句:排序。
connect by 子句:连接条件。关键词prior,prior跟父节点列parentid放在一起,就是往父结点方向遍历;prior跟子结点列subid放在一起,则往叶子结点方向遍历,
parentid、subid两列谁放在“=”前都无所谓,关键是prior跟谁在一起。
order by 子句:排序。
select * from 表名 start with sell_roleid = 1 connect by NOCYCLE prior buy_roleid = sell_roleid;
相关文章推荐
- Oracle start with connect by prior 递归查询用法
- Oracle start with ... connect by prior 用法
- oracle start with connect by prior 递归查询
- Oracle start with connect by prior 用法(递归查询树形结构)
- oracle start with connect by prior 用法
- Oracle start with connect by prior 用法
- start with connect by prior 递归查询用法
- start with connect by prior 递归查询用法
- Oracle start with......connect by prior......子句实现递归查询
- start with connect by prior 递归查询用法
- oracle递归查询 start with connect by prior
- 【Oracle】START WITH...CONNECT BY PRIOR...递归查询
- Oracle START WITH...CONNECT BY PRIOR的用法
- Oracle_start_with_connect_by_prior_用法
- Oracle中的递归查询语法(start with...connect by prior)
- Oracle start with ... connect by prior 用法
- start with connect by prior 递归查询用法
- oracle 中的select ...connect by prior ...start with 及(+)的用法
- Oracle递归查询 Start with…Connect By用法
- Oracle_start_with_connect_by_prior_用法