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


Please Help Members By Posting Answers For Below Questions

Explain select statements in sql?

597


Explain how to use transactions efficiently : transact sql

538


Can we insert in view in sql?

573


what is the difference difference between procedure and packages

9247


What is sql procedures and functions?

541






What are the different types of dbmss?

571


How to raise user-defined exception with custom sqlerrm ?

686


what is the difference between $message and $$message? : Sql dba

559


how to use case expression? : Sql dba

561


how to get a list of indexes of an existing table? : Sql dba

528


what is the difference between rownum pseudo column and row_number() function? : Sql dba

624


What are all the different normalizations?

593


Is sql open source?

553


What is numeric function sql?

549


What do you understand by pl/sql cursors?

558