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

select a.ename, b.enanme as manager
from emp as a, emp as b
where a.empno = b.mgr_id

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How do we use distinct statement? What is its use?

1038


what is the use of anchoring object? what r the difference between anchoring object & enclosing object? can any one tell me all the details?

2501


Is a secondary key the same as a foreign key?

1046


What is a crud api?

956


Can we rename a column in the output of sql query?

997


How to run pl/sql statements in sql*plus?

1091


What are the different schemas objects that can be created using pl/sql?

1040


What does an inner join do?

1196


Why do we need databases?

1055


how can I make a script that can be bi-language (supports english, german)? : Sql dba

1019


What are the types of views in sql?

1107


What are the two different parts of the pl/sql packages?

1093


Is sql harder than python?

1110


what are the disadvantages of mysql? : Sql dba

1151


What does joining a thread mean?

1024