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 / alok narayan
1.
select empname,(select empname from e1 b
where b.empid =a.mgrid) from e1 a;
2.
select a.empname empname,b.empname mgrname from e1 a,e1 b
where a.mgrid=b.empid order by a.empname ;
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
What is the purpose of normalization?
How many sql core licenses do I need?
How many sql statements are used? Define them.
What is forward declaration in pl sql?
What is the difference between sql, mysql and sql server?
How to write pl sql program in mysql command prompt?
What is write ahead logging in sql server?
Can there be 2 primary keys in a table?
What is percent sign in sql?
What is nested table in pl sql?
what are tables and fields? : Sql dba
What is the difference between mdf and ndf files?
What are pl/sql cursors?
Is hadoop a nosql?
Is sql injection illegal?