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 / rajesh venati

select e.ename as employee_name,m.ename as manager_name from
emp e, emp m where e.mgr_id=m.empno;

Is This Answer Correct ?    8 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is clustered index a primary key?

885


State some properties of relational databases?

1003


how do you know if your mysql server is alive? : Sql dba

1027


what is the difference between truncate and delete statement? : Transact sql

1017


how to analyze tables with 'mysqlcheck'? : Sql dba

960


What are secondary keys?

923


What is restrict in sql?

1035


What is dense_rank?

879


How do I order by ascending in sql?

958


What pl/sql package consists of?

1033


what are all types of user defined functions? : Sql dba

998


What are the parameter modes supported by pl/sql?

1022


What view means?

931


Can one improve the performance of sql*loader? : aql loader

983


Explain how exception handling is done in advance pl/sql?

958