The CONNECT BY clause specifies the relationship between parent rows and child rows of the hierarchy. The connect_by_condition can be any condition, however, it must use the PRIOR operator to refer to the parent row. Ex: SELECT firstname, lastname, empid, managerid, LEVEL FROM emp CONNECT BY PRIOR empid = managerid;