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

I think this one will work
Select a.ename as Employee ,b.ename as Manager from
EMP ,EMP B
where
A.MGR_ID=B.empno

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the difference between 'between' & 'and' operators in sql

948


How to write a query to show the details of a student from students table whose

942


What is the difference between clustered and non-clustered indexes?

1029


Write the order of precedence for validation of a column in a table? I. Done using database triggers. Ii. Done using integarity constraints

1023


What is a primary key called that is made up of more than one field?

1286


What is a crud api?

903


Can we write dml inside a function in sql server?

900


What are the properties of a transaction?

1072


how to concatenate two character strings? : Sql dba

1033


What does seeding a database mean?

895


how to use regular expression in pattern match conditions? : Sql dba

966


What is parallel hint?

1223


What is parameter substitution in sql?

977


How long it takes to learn pl sql?

951


how to do backup entire database? : Transact sql

1070