Skip to Main Content

SQL & PL/SQL

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!

Interested in getting your voice heard by members of the Developer Marketing team at Oracle? Check out this post for AppDev or this post for AI focus group information.

Hierarchical Queries in Oracle SQL : want to get all parents & child nodes of a specific employee

Azam SajidFeb 26 2018 — edited Feb 26 2018

I have a query which showing all employees related with Jones(child nodes).

SELECT

   ENAME

FROM

   EMP

CONNECT BY

   PRIOR EMPNO = MGR

START WITH

   ENAME = 'JONES';

ENAME

----------

JONES

SCOTT

ADAMS

FORD

SMITH

FORD

SMITH

But I also want to show all parents nodes related to Jones.

This post has been answered by Frank Kulash on Feb 26 2018
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Mar 26 2018
Added on Feb 26 2018
3 comments
2,548 views