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 / suresh babu

select t1.empname,t2.empname from emp t1,emp t2 where
t1.mgrid = t2.empid;

This query is self join,Which is display your requirement.

Is This Answer Correct ?    4 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Write a sql query to convert all character to uppercase after hypen.

1416


What is the difference between left join and right join?

929


What are the advantages of sql? Explain

1083


Does user triggers have entry for trigger with compilation errors?

1019


how many triggers are allowed in mysql table? : Sql dba

1040


what is the functionality of the function htmlentities? : Sql dba

929


Is null operator in sql?

1014


How can I get the number of records affected by a stored procedure?

1042


Is sql a oracle?

951


What is the benefit of foreign key?

1009


who introduced sql?

999


What is a recursive join sql?

1051


what is a stored procedure? : Sql dba

1108


What is the mutating table and constraining table?

1010


Enlist the characteristics of pl/sql?

1779