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 / nanne saheb c

select e.empname,m.ename mgrname from emp e,emp m
where e.mgrid=m.empid;

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is a natural join?

1074


What is the difference between sql and mysql?

1119


What is a unique constraint?

1078


What is difference between stored procedure and trigger?

1169


What are primary key and foreign key and how they work?

978


what is a relationship and what are they? : Sql dba

1101


write an sql query to find names of employee start with 'a'? : Sql dba

1027


Can we have two clustered index on a table?

1025


How to execute a stored procedure?

1092


What is sql rowcount?

1023


how to create a new table in mysql? : Sql dba

986


how do you know the version of your mysql server? : Sql dba

1004


how to dump a table to a file with 'mysqldump'? : Sql dba

1036


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

1128


what is an index? : Sql dba

998