i have a table emp and columns ename,empno,mgr_id,i need ename,manager name as result i.e employee respective manager.. example
empno ename mgr_id
1 john 3
2 paul 3
3 smith 1
4 kevin 1
5 stewart 2
result has to look like this
ename manager
john smith
paul smith
smith john
kevin john
stewart paul
can u plz help me out in this.....
Answer Posted / monika
select empno,ename
from emp
start with mgr_id is null
connect by prior empno=mgr_id;
Is This Answer Correct ? | 0 Yes | 2 No |
Post New Answer View All Answers
What is the difference between partition and index?
what are the limitations of mysql in comparison of oracle? Mysql vs. Oracle. : Sql dba
What is the difference between execution of triggers and stored procedures?
Which join condition can be specified using on clause?
Can pl sql procedure have a return statement?
What is difference between pls_integer and integer?
What is the current version of postgresql?
What are all the different normalizations?
how to return query output in html format? : Sql dba
What is cursor in pl sql with examples?
What is db journal file?
what is cross join? : Sql dba
what is the difference between $message and $$message? : Sql dba
what is a primary key? : Sql dba
What is pl sql block structure?