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 / gunturajesh

select a.empname empname,b.empname mgrname from emp a,emp b
where a.mgrid=b.empid

Is This Answer Correct ?    20 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Why use subqueries instead of joins?

1034


Is left join inner or outer?

964


How do I restart sql?

915


Mention what is the plv (pl/vision) package offers?

1057


What's the difference between inner join and left join?

949


Why are indexes and views important to an organization?

899


how to include character strings in sql statements? : Sql dba

1001


What is cursor in pl sql?

1052


what is the difference between char_length and length? : Sql dba

993


How can you create an empty table from an existing table?

1012


how can we encrypt and decrypt a data present in a mysql table using mysql? : Sql dba

1125


Cite the differences between execution of triggers and stored procedures?

1031


What are the parts of a sql statement?

1030


difference between anonymous blocks and sub-programs.

1081


What is an index? What are the types of indexes? How many clustered indexes can be created on a table?

994