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
Explain select statements in sql?
Explain how to use transactions efficiently : transact sql
Can we insert in view in sql?
what is the difference difference between procedure and packages
What is sql procedures and functions?
What are the different types of dbmss?
How to raise user-defined exception with custom sqlerrm ?
what is the difference between $message and $$message? : Sql dba
how to use case expression? : Sql dba
how to get a list of indexes of an existing table? : Sql dba
what is the difference between rownum pseudo column and row_number() function? : Sql dba
What are all the different normalizations?
Is sql open source?
What is numeric function sql?
What do you understand by pl/sql cursors?