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 cursor and its type, what is ref cursor write a syntax to pass ref cursor into procedure out fucntion and call the procedure

1089


Can one improve the performance of sql*loader? : aql loader

981


How do you respond to dementia behavior?

925


how to use regular expression in pattern match conditions? : Sql dba

963


What is the purpose of design view?

951


describe mysql connection using mysql binary. : Sql dba

993


How does stored procedure reduce network traffic?

966


what is 'mysqlimport'? : Sql dba

974


how to drop an existing table in mysql? : Sql dba

982


How to run sql*plus commands in sql developer?

1085


explain what is mysql? : Sql dba

1031


What is sql lookup?

864


What is error ora-12154: tns:could not resolve the connect identifier specified?

1016


what are the different type of normalization? : Sql dba

969


Why sql query is slow?

929