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
how to check myisam tables for errors? : Sql dba
Can we insert in view in sql?
What is a relationship and what are they?
When to use inner join and left join?
what is a materialized view? : Sql dba
Why do we use function in pl sql?
Can we group by two columns in sql?
Why are aggregate functions called so?
Which one is better sql or oracle?
Why is partition used in sql?
What is bitemporal narrowing?
What is rename command in sql?
What is the difference between execution of triggers and stored procedures?
What is cursor in pl sql?
What is oracle and pl sql?