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

How can you load microsoft excel data into oracle? : aql loader

1174


What is a composite primary key?

1095


what is a view? : Sql dba

1095


What is rownum in sql?

1044


What is a join query?

966


what is the difference between nested subquery and correlated subquery?

1056


what are enums used for in mysql? : Sql dba

1170


What is sql procedures and functions?

1009


What is a data manipulation language?

1024


Can sql developer connect to db2?

1054


Are stored procedures faster than dynamic sql?

1041


What are different types of indexes?

1011


what is a tablespace? : Sql dba

1053


can sql servers linked to other servers like oracle? : Sql dba

1009


what does it mean to have quoted_identifier on? : Sql dba

1146