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...

i have a table emp and columns ename,empno,mgr_id,i need ename,manager name as result i.e employee respective manager.. example
empno ename mgr_id
1 john 3
2 paul 3
3 smith 1
4 kevin 1
5 stewart 2

result has to look like this

ename manager
john smith
paul smith
smith john
kevin john
stewart paul


can u plz help me out in this.....

Answer Posted / john bershan

self join will accomplish this task.try below query

select a.ename,b.ename as manager from emp a,emp b
where a.empno = b.mgrid;

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the types of index in sql?

1015


What are the operators in sql?

970


Can ddl statements be used in pl/sql?

1068


What is the difference between the sql*loader and import utilities? : aql loader

976


What are triggers in sql?

972


What is pl sql block in dbms?

949


How is data stored on a disk?

962


What is database white box testing and black box testing?

1046


What is column?

940


What is union?

1082


What is a .db file?

926


What is offset in sql query?

1069


What does count (*) mean in sql?

1516


What are the two virtual tables available at the time of database trigger execution?

1157


What is the difference between the implicit and explicit cursors?

993