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 I copy :old and :new pseudo-records in/to an oracle stored procedure?
Why triggers are used?
how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba
how to fetch alternate records from a table? : Sql dba
what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba
how can we know the count/number of elements of an array? : Sql dba
Is record in oracle pl sql?
What does the file extension accdb stand for?
what are the differences between char and varchar? : Sql dba
Which command is used to delete a trigger?
Explain what is an index?
when is the use of update_statistics command? : Sql dba
what is transaction? : Sql dba
What is query syntax?
Is trigger a stored procedure?