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


Please Help Members By Posting Answers For Below Questions

How do I upgrade sql?

546


What is database sql?

539


What is audit logout in sql profiler?

587


What is the use of %rowtype?

535


Is postgresql a server?

575






what are the authentication modes in sql server? : Sql dba

528


Does postgresql run on the cloud?

588


How does an execution block start and end in pl sql?

498


How long will it take to learn pl sql?

522


How do I count records in sql?

514


Is sql better than excel?

517


What steps server process has to take to execute an update statement?

506


what is the difference between rownum pseudo column and row_number() function? : Sql dba

616


What is procedure explain with program?

550


What is use of term?

618




-2NC8ZH7G4C');