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
Is merge a dml statement?
How can triggers be used for the table auditing?
Can we edit a view in sql?
How do you modify a table in sql?
Is left join inner or outer by default?
what is the difference between group by and order by in sql? : Sql dba
Why cannot I use bind variables in ddl/scl statements in dynamic sql?
What are predefined functions in sql?
Is sqlexception checked or unchecked?
what are the authentication modes in sql server? How can it be changed? : Sql dba
How can you get sql*loader to commit only at the end of the load file? : aql loader
Explain alias in sql?
What is sql select statement?
What is the difference between explicit and implicit cursors in oracle?
Is it possible to link two groups inside a cross products after the cross products group has been created?