Hi all,
i have a table as follows
empid empname mgrid deptid
1 a 3 4
2 b 1 5
3 c 2 3
4 d 3 6
5 e 4 7

i want the output as
empname mgrname
a c
b a
c b
d c
e d

Answer Posted / gunturajesh

select a.empname empname,b.empname mgrname from emp a,emp b
where a.mgrid=b.empid

Is This Answer Correct ?    20 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is sql and db2?

538


What is the difference between a subquery and a join?

531


what is a materialized view? : Sql dba

577


What is auto increment feature in sql?

625


Explain the the delete statements in sql?

581






What is pl sql package?

600


What is data abstraction in sql?

515


Can we update views in sql?

537


What is the difference between function, procedure and package in pl/sql?

564


What are sql injection vulnerabilities?

500


What is a delimiter in sas?

550


What are the different tcl commands in sql?

624


What is the difference between sql and isql*plus?

517


Can you join views in sql?

545


Do we need to create index on primary key?

471