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 / cbigmudre
select a.ename, b.enanme as manager
from emp as a, emp as b
where a.empno = b.mgr_id
| Is This Answer Correct ? | 2 Yes | 1 No |
Post New Answer View All Answers
What is difference between left and right outer join?
What is mdf ldf and ndf?
What are the different set operators available in sql?
what is an extent ? : Sql dba
what are all the common sql function? : Sql dba
What does rownum mean in sql?
How to load data with sql*loader?
How do temporal tables work?
What is the life of an sql statement?
What are the uses of merge?
What is a left inner join?
Why do we use partitions in sql?
what is a join? : Sql dba
What is sql analyzer?
What is the benefit of foreign key?