1. 程式人生 > >oracle遞迴查詢報錯

oracle遞迴查詢報錯

SELECT *
FROM T_OrgCom t
where t.systemcode = '04' and t.ENABLED = '1'
START WITH t.id='00000000'
CONNECT BY   PRIOR t.ID=t.pid
報錯:使用者資料中的connect by 迴圈


SELECT *
FROM T_OrgCom t
where t.systemcode = '04' and t.ENABLED = '1'
START WITH t.id='00000000'
CONNECT BY NOCYCLE  PRIOR t.ID=t.pid
新增NOCYCLE
NOCYCLE  不產生迴圈