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 union? : Sql dba
What do you understand by pl/sql records?
What is Histogram?
What is sql trigger example?
What is the use of <> sql?
What is keys and its types?
Differentiate between pl/sql and sql?
How do I create a sql database?
What are the types of views in sql?
What is triggering circuit?
how to include numeric values in sql statements? : Sql dba
How long it takes to learn pl sql?
What is the usage of distinct keyword?
What is t-sql? : Transact sql
How does a covering index work?