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
Can we use pl sql in sql server?
What is acid property in a database?
1) Synonyms 2) Co-related Subquery 3) Different Jobs in Plsql 4) Explain Plan 5) Wrap 6) Query Optimization Technique 7) Bulk Collect 8) Types of index 9) IF primary key is created then the index created ? 10) Foreign Key 11) Exception Handling 12) Difference Between Delete and Trunc 13) Procedure Overloading 14) Grant Revoke 15) Procedure Argument types. 16) Functions. 17) Joins
Which is faster subquery or join?
how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba
what does the t-sql command ident_incr does? : Transact sql
What is rank () in sql?
Where is all the data on the internet stored?
What are %type and %rowtype for?
What is a record in pl/sql?
What does the sign mean in sql?
what is cross join? : Sql dba
What is meant by user defined function?
What is a procedure in pl sql?
Define the select into statement.