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

How to fetch values from testtable1 that are not in testtable2 without using not keyword?

1155


Are sql connections encrypted?

951


Write the command to remove all players named sachin from the players table.

1119


Which function is used to return remainder in a division operator in sql?

1073


What does fetching a cursor do?

1018


Can a select statement fire a trigger?

1093


Is null operator in sql?

974


What is restrict in sql?

1030


What does varchar include?

903


what is the different between now() and current_date()? : Sql dba

929


What is sql partition?

1035


Define overloaded procedure?

1011


Can we call procedure in select statement?

968


What is natural join in sql?

916


what is recursive stored procedure? : Sql dba

929