Skip to Main Content

Oracle Database Discussions

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Rewrite of a recursive query using hierarchy

orausernNov 9 2011 — edited Nov 9 2011
Hi,
We are on oracle 10.2.0.4 on solaris 10. My question is on a sql query. Is it possible to rewrite a query to avoid the connect by and prior constructs and use joins? For example i have the following query:
SELECT empno,
       ename,
       job,
       mgr,
       hiredate
FROM   emp
START WITH empno in (7566,7698)
CONNECT BY PRIOR empno = mgr
how can it be rewritten using a two table join (self join)? I am not sure if it can be done and need help on whether it is possible.
thanks
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Dec 7 2011
Added on Nov 9 2011
8 comments
343 views