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
How do I upgrade sql?
What is database sql?
What is audit logout in sql profiler?
What is the use of %rowtype?
Is postgresql a server?
what are the authentication modes in sql server? : Sql dba
Does postgresql run on the cloud?
How does an execution block start and end in pl sql?
How long will it take to learn pl sql?
How do I count records in sql?
Is sql better than excel?
What steps server process has to take to execute an update statement?
what is the difference between rownum pseudo column and row_number() function? : Sql dba
What is procedure explain with program?
What is use of term?