sql - Connect by clause output not coming as desired -
i have following query against emp
table
select empno,mgr,ename,level emp start ename = 'king' connect prior empno = mgr;
desired output should show ename
of manager , without using self join.
add alias in clause , use nested correlated subquery in select clause.
select empno,mgr,ename,level, (select ename emp empno=e.mgr) mgrname emp e start ename = 'king' connect prior empno = mgr;
Comments
Post a Comment