Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

What is the purpose of normalization?

1088


How many sql core licenses do I need?

999


How many sql statements are used? Define them.

1081


What is forward declaration in pl sql?

1141


What is the difference between sql, mysql and sql server?

1177


How to write pl sql program in mysql command prompt?

1165


What is write ahead logging in sql server?

1101


Can there be 2 primary keys in a table?

1046


What is percent sign in sql?

1328


What is nested table in pl sql?

1123


what are tables and fields? : Sql dba

1105


What is the difference between mdf and ndf files?

1163


What are pl/sql cursors?

1104


Is hadoop a nosql?

1054


Is sql injection illegal?

1082