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 / praveen h

I think this one will work
Select a.ename as Employee ,b.ename as Manager from
EMP ,EMP B
where
A.MGR_ID=B.empno

Is This Answer Correct ?    9 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is form and report?

515


What is synonyms?

570


how to get @@error and @@rowcount at the same time? : Sql dba

525


how to convert character strings to numeric values? : Sql dba

572


What is output spooling in sql*plus?

546






Does sql require a server?

523


What is the difference between truncate and drop statements?

571


What are data types in pl sql?

554


Can we rollback truncate?

532


List the various privileges that a user can grant to another user?

572


what is sql server agent? : Sql dba

599


How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?

579


Can sql developer connect to db2?

582


What is sequence in sql?

506


hi,i plan to put experience on PLSQL ,can anyone suggest me for any institutes in bangalore or how to prepare for interviews

1521