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 truncate and delete statement? : Transact sql
What is optimistic concurrency control? : Transact sql
What is sqlexception in java?
What is the meaning of disabling a trigger?
What are stored procedures used for?
Why do we use sql constraints? Which constraints we can use while creating database in sql?
Mention what does the hierarchical profiler does?
How can I tell if sql is running?
How many types of keys are there in sql?
What is primary key and foreign key?
What does 0 mean in sql?
What is keys and its types?
How can you get sql*loader to commit only at the end of the load file? : aql loader
Explain about various levels of constraint.
Why join is faster than subquery?