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
Does inner join remove duplicates?
Table A Table B 1 1 2 1 3 1. Union & union all --> A Union B , A Union all B 2. Minus , Intersect --> A minus B , B Minus A , A Intersect B 3. Joins A join B , A Left Join B A Right Join B , A full Join B 4. %Type - Uses & Benifit 5. Truncate & Delete 6. Pragma Autonomus Transaction 7. how to Perform DDL from function or procedure 8. Can we have DML inside Function 9. Rank & Dense Rank diffrence 10. Water Mark in Oracle 11. Index , Can we have index in all column of table if no then why ?
What is offset in sql query?
explain the difference between myisam static and myisam dynamic. : Sql dba
How do I run a sql trace?
how do you login to mysql using unix shell? : Sql dba
how many sql ddl commands are supported by 'mysql'? : Sql dba
what is the use of double ampersand (&&) in sql queries?
What are inner outer left and right joins in sql?
how to analyze tables with 'mysqlcheck'? : Sql dba
what is the syntax used for partition in tsql? : Transact sql
what are myisam tables? : Sql dba
What is the difference between execution of triggers and stored procedures?
What is sql query limit?
What is vector point function?