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 / rajesh venati

select e.ename as employee_name,m.ename as manager_name from
emp e, emp m where e.mgr_id=m.empno;

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Where are my tempfiles, I don't see them in v$datafile or dba_data_file?

547


Why is there a need for sqlcode and sqlerrm variables?

586


How subquery works in sql?

542


What is sql used for?

646


What is sql clause?

542






Why plvtab is considered as the easiest way to access the pl/sql table?

619


define sql insert statement ? : Sql dba

550


What is difference between sql and excel?

515


What is cross join example?

552


Write the command to remove all players named sachin from the players table.

738


What is constant in pl sql?

518


What is the difference between delete, truncate and drop command?

549


What is oracle and pl sql?

663


is mysql query is case sensitive? : Sql dba

562


What is int identity in sql?

575