mxm910821 发表于 2013-1-14 08:42:28

ORACLE Connect By Level Start With 的使用(Hierarchical query 层次查询)




<div style="color: #4b4b4b; font-size: 13px; line-height: 19px;">Syntax 1CONNECT BY  <condition> START WITH <condition>Syntax 2START WITH <condition> CONNECT BY  <condition>参考网址:http://asktom.oracle.com/pls/asktom/f?p=100:11:0::::P11_QUESTION_ID:489772591421
            http://psoug.org/reference/connectby.html
            http://www.oradev.com/connect_by.jsp
           http://philip.greenspun.com/sql/trees.html
查找员工编号为7369的领导:
<div class="cnblogs_code" style="background-color: #f5f5f5; font-size: 12px; margin-top: 5px; margin-right: 0px; margin-bottom: 5px; margin-left: 0px; padding: 5px; border: 1px solid #cccccc;">1 SELECT LEVEL,E.* FROM EMP E CONNECT BY PRIOR E.MGR = E.EMPNOSTART WITH E.EMPNO = 78762 ORDER BY LEVEL DESC
页: [1]
查看完整版本: ORACLE Connect By Level Start With 的使用(Hierarchical query 层次查询)