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

Can I copy :old and :new pseudo-records in/to an oracle stored procedure?

1195


Why triggers are used?

968


how can we transpose a table using sql (changing rows to column or vice-versa) ? : Sql dba

935


how to fetch alternate records from a table? : Sql dba

1085


what is the difference between mysql_fetch_object and mysql_fetch_array? : Sql dba

1037


how can we know the count/number of elements of an array? : Sql dba

1044


Is record in oracle pl sql?

943


What does the file extension accdb stand for?

958


what are the differences between char and varchar? : Sql dba

1059


Which command is used to delete a trigger?

1307


Explain what is an index?

1035


when is the use of update_statistics command? : Sql dba

1027


what is transaction? : Sql dba

991


What is query syntax?

954


Is trigger a stored procedure?

922