ORACLE--Connect By、Level、Start With的使用(Hierarchical query-層次查詢)

查找員工編號爲7369的領導: 1 SELECT LEVEL,E.* FROM EMP E CONNECT BY PRIOR E.MGR = E.EMPNO START WITH E.EMPNO = 7876 2 ORDER BY LEVEL DESC "start with" -- this identifies all LEVEL=1 nodes in the tree "connect b
相關文章
相關標籤/搜索