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 are the key differences between SQL and PL SQL?

851


Can we commit in trigger?

700


Explain table and field in sql?

780


How do you update a table in sql?

680


What can I use instead of union in sql?

707






How can triggers be used for the table auditing?

753


What is partition in sql query?

719


Can we use threading in pl/sql?

712


difference between anonymous blocks and sub-programs.

818


What is mutating table error?

882


What is pl sql code?

752


Does sql*plus have a pl/sql engine?

753


What is the difference between delete and truncate commands?

689


What are the different types of database management systems?

721


What is numeric function sql?

722