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 I save the results of sql query in a file?
Which language is used in sql?
Explain the structure of pl/sql in brief.
what is the difference between mysql_fetch_array and mysql_fetch_object? : Sql dba
What is crud stand for?
how to run 'mysql' commands from a batch file? : Sql dba
What is difference between sql and mysql?
What is row_number () in sql?
What is the usage of sql functions?
In pl/sql, what is bulk binding, and when/how would it help performance?
What is nested table in pl sql?
What is the use of count (*) in sql?
What are the different types of constraints?
How many tables can a sql database have?
Can you do multiple joins in sql?