I understand when a loop can occur in Oracle. Theoritically it says if a record is both parent to another node and at the same time it is child to it, then it can enter into a loop.
But I can't catch why my this particular query is running into a loop.
SELECT Empno, Ename, Job
FROM Emp
START WITH Empno = 7839
CONNECT BY PRIOR
Job='PRESIDENT'
Can someone please explain me how this data can result into a loop. I made a CONNECT_BY_ISCYCLE check and found that the record looping is KING(President). But I still don't understand how can it be possible, as KING is President and I don't see any way in which it is becoming both child and parent to any record in the table.
Please explain me, why this is an error and where is the loop?
Thanks in advance.
FYI, The table is the default EMP table in SCOTT user in Oracle.