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 are the differences between implicit and explicit cursors?
Can one improve the performance of sql*loader? : aql loader
Can we use update in sql function?
Explain the structure of pl/sql in brief.
Is it possible to pass parameters to triggers?
How do I create a memory optimized filegroup?
What are hotfixes and patches?
Explain table and field in sql?
How do you delete data from a table?
how is exception handling handled in mysql? : Sql dba
Mention what does plv msg allows you to do?
What is difference between inner join and self join?
What is cross join example?
What is sharding in sql?
What is the left table in sql?