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
Explain cursor types?
What is lookup table in sql?
what are different types of collation sensitivity? : Sql dba
What is the difference between a query and a report?
What is the difference between view and stored procedure?
Do triggers have restrictions on the usage of large datatypes, such as long and long raw?
Does sqlite need a server?
When you have to use a default "rollback to" savepoint of plvlog?
How is use pl and sql?
Cite the differences between execution of triggers and stored procedures?
What is sql trigger example?
how mysql optimizes distinct? : Sql dba
Explain locks? : Transact sql
How subquery works in sql?
What are all types of user defined functions?