As you all know scott.emp
table of Oracle doesn't have any cycle in hierarchy.
But I changed emp
table a little (UPDATE emp SET mgr=7654 WHERE empno=7698)
where I changed Martin's manager as Blake and Blake's manager as Martin and fired following query.
SELECT
empno,
ename,
mgr,
level,
connect_by_iscycle
FROM emp
START WITH mgr IS NULL
CONNECT BY NOCYCLE prior empno=mgr
ORDER SIBLINGS BY mgr
But it doesn't give Martin and Blake related entries and doesn't display 1 at expected field. Please answer the reason if you can figure out.