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

What is bind variable in pl sql?

1106


What is parameter substitution in sql?

1081


How to connect a sql*plus session to an oracle server?

1176


How insert into statements in sql?

1123


Explain select statements in sql?

1107


What is materialized view. What are different methods of refresh?

1442


When do we use triggers?

1149


What is a string data type in sql?

1102


what is the difference between a web-garden and a web-farm? : Sql dba

1144


Where can I learn sql for free?

1049


What is indexes?

1117


Enlist the advantages of sql.

1054


How to fix oracle error ora-00942: table or view does not exist

1084


how to add a new column to an existing table in mysql? : Sql dba

1115


What is trigger with example?

1170