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
How do we use distinct statement? What is its use?
what is the use of anchoring object? what r the difference between anchoring object & enclosing object? can any one tell me all the details?
Is a secondary key the same as a foreign key?
What is a crud api?
Can we rename a column in the output of sql query?
How to run pl/sql statements in sql*plus?
What are the different schemas objects that can be created using pl/sql?
What does an inner join do?
Why do we need databases?
how can I make a script that can be bi-language (supports english, german)? : Sql dba
What are the types of views in sql?
What are the two different parts of the pl/sql packages?
Is sql harder than python?
what are the disadvantages of mysql? : Sql dba
What does joining a thread mean?