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

Popular posts from this blog

facebook - android ACTION_SEND to share with specific application only -

python - Creating a new virtualenv gives a permissions error -

javascript - cocos2d-js draw circle not instantly -