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 / john bershan
self join will accomplish this task.try below query
select a.ename,b.ename as manager from emp a,emp b
where a.empno = b.mgrid;
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
What are the types of index in sql?
What are the operators in sql?
Can ddl statements be used in pl/sql?
What is the difference between the sql*loader and import utilities? : aql loader
What are triggers in sql?
What is pl sql block in dbms?
How is data stored on a disk?
What is database white box testing and black box testing?
What is column?
What is union?
What is a .db file?
What is offset in sql query?
What does count (*) mean in sql?
What are the two virtual tables available at the time of database trigger execution?
What is the difference between the implicit and explicit cursors?