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 / sudhan
select e1.ename EmpName,e2.ename MgrName from emp e1,emp e2
where e1.mgr_id=e2.ename;
| Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
Can I join the same table twice?
What are different methods to trace the pl/sql code?
How to add a column ‘salary’ to a table employee_details?
What are the query optimization techniques?
What is #table in sql?
What language is oracle sql developer?
What is a loop in sql?
If the application is running very slow? At what points you need to go about the database in order to improve the performance?
what is the difference between a web-garden and a web-farm? : Sql dba
What is pl sql code?
What are the uses of sysdate and user keywords?
What is a table partition?
What is sql*loader and what is it used for? : aql loader
How do I edit a stored procedure?
Why do we create stored procedures & functions in pl/sql and how are they different?