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 / praveen h

I think this one will work
Select a.ename as Employee ,b.ename as Manager from
EMP ,EMP B
where
A.MGR_ID=B.empno

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between truncate and drop statements?

578


What is autocommit sql?

540


Explain how can you save or place your msg in a table?

597


How do I partition a table in sql?

542


How do I upgrade sql?

551






Can you inner join the same table?

527


Does truncate free space?

520


what happens if null values are involved in expressions? : Sql dba

565


Does truncate table reset auto increment?

528


How can I delete duplicate rows?

564


What is a memo field?

529


How can I make sql query run faster?

561


How can you get sql*loader to commit only at the end of the load file? : aql loader

555


What is sql query limit?

510


Can we use insert statement in function?

516