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

select e1.ename EmpName,e2.ename MgrName from emp e1,emp e2
where e1.mgr_id=e2.ename;

Is This Answer Correct ?    0 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Can I join the same table twice?

996


What are different methods to trace the pl/sql code?

1050


How to add a column ‘salary’ to a table employee_details?

955


What are the query optimization techniques?

888


What is #table in sql?

997


What language is oracle sql developer?

941


What is a loop in sql?

937


If the application is running very slow? At what points you need to go about the database in order to improve the performance?

949


what is the difference between a web-garden and a web-farm? : Sql dba

1012


What is pl sql code?

995


What are the uses of sysdate and user keywords?

1053


What is a table partition?

1038


What is sql*loader and what is it used for? : aql loader

1097


How do I edit a stored procedure?

950


Why do we create stored procedures & functions in pl/sql and how are they different?

889