递归连接查询

select * from DT_INDUSTRY t 
start with industrycode IN (select industrycode from SYS_COMPANY_INDUSTRY t WHERE t.compid='541572482EDA4D4A9AA6E4AFB31A3782')

connect by prior INDUSTRYPCODE = industrycode

  SELECT SUBSTR(MAX(SYS_CONNECT_BY_PATH(NAME, '@sirc')), 6) AS NAME,
                 SUBSTR(MAX(SYS_CONNECT_BY_PATH(ID, '@sirc')), 6) AS ID    
            FROM SpecificFolderRelation B
           START WITH B.ID = P_ID
          CONNECT BY PRIOR B.PARENTID = B.ID;

  

posted @ 2014-10-13 10:03  许志伟  阅读(297)  评论(0编辑  收藏  举报