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

Answers were Sorted based on User's Feedback



Hi all, i have a table as follows empid empname mgrid deptid 1 a 3 4 2 b ..

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

Hi all, i have a table as follows empid empname mgrid deptid 1 a 3 4 2 b ..

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

Hi all, i have a table as follows empid empname mgrid deptid 1 a 3 4 2 b ..

Answer / alok narayan

1.
select empname,(select empname from e1 b
where b.empid =a.mgrid) from e1 a;

2.
select a.empname empname,b.empname mgrname from e1 a,e1 b
where a.mgrid=b.empid order by a.empname ;

Is This Answer Correct ?    0 Yes 0 No

Hi all, i have a table as follows empid empname mgrid deptid 1 a 3 4 2 b ..

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

More SQL PLSQL Interview Questions

What is cursor in pl sql?

0 Answers  


what is sql server agent? : Sql dba

0 Answers  


Does sql*plus also have a pl/sql engine?

0 Answers  


Does mysql support pl sql?

0 Answers  


How many types of keys are there in sql?

0 Answers  


What is the difference between microsoft sql and mysql?

0 Answers  


How do you write a subquery?

0 Answers  


What does select top 1 do in sql?

0 Answers  


table having two columns - entity,zone enity zone pen east pen west pen north pen south pen east pencil east pencil east pencil west I want the output as : entity east west north south pen 2 1 1 1 pencil 2 1 0 0

2 Answers  


What is the difference between CHAR and VARCHAR2? If VARCHAR2 serves the uses of CHAR why CHAR is still used and not been discarded yet?

9 Answers   Oracle,


List different type of expressions with the example.

0 Answers  


What is the difference between join and natural join?

0 Answers  


Categories