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 schema? : Sql dba

1105


What is Difference Between Unique and Primary Key Constraints?

1152


What are inner outer left and right joins in sql?

1057


What is date functions?

1088


How delete all data from all tables in sql?

983


What is query syntax?

1018


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

1172


How can you know that statistics should be updated?

1126


What are the types of records?

1033


What are the different parts of a package?

1152


What are sql queries used for?

1072


What is sql stand for?

1033


Write the order of precedence for validation of a column in a table? I. Done using database triggers. Ii. Done using integarity constraints

1130


Is it possible to read/write files to-and-from PL/SQL?

1148


Can a table contain multiple foreign key’s?

1049