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 we insert in view in sql?

1107


Is sql a microsoft product?

997


What do we need to check in database testing?

1069


What is user defined functions?

1031


What are the different tcl commands in sql?

1236


What are the advantages of indexing?

1032


What is set transaction?

1090


How do you run a query?

1051


What is function and procedure in pl sql?

1121


what is acid property in database? : Sql dba

1071


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

1162


Are left and right joins the same?

1163


what is the difference between clustered and non clustered index in sql? : Sql dba

1193


What is embedded sql what are its advantages?

1108


Can we use view in stored procedure?

960