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

Is oracel sql developer written in java?

1089


Does varchar need length?

979


How to get unique records from a table?

941


what is 'trigger' in sql? : Sql dba

1067


Is id a reserved word in sql?

1133


Does mysql_real_escape_string prevent sql injection?

937


What is #table in sql?

1068


Is there any restriction on the use of union in embedded sql?

1147


What are character functions?

1072


What is mutating error?

951


Is sql microsoft?

1032


Cite the differences between execution of triggers and stored procedures?

1071


How do I run a script in sql developer?

935


How to run sql statements through the web interface?

1020


how to present a past time in hours, minutes and seconds? : Sql dba

991