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

select empno,ename
from emp
start with mgr_id is null
connect by prior empno=mgr_id;

Is This Answer Correct ?    0 Yes 2 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

how to check myisam tables for errors? : Sql dba

1256


Can we insert in view in sql?

1000


What is a relationship and what are they?

1047


When to use inner join and left join?

901


what is a materialized view? : Sql dba

995


Why do we use function in pl sql?

1005


Can we group by two columns in sql?

942


Why are aggregate functions called so?

896


Which one is better sql or oracle?

898


Why is partition used in sql?

1049


What is bitemporal narrowing?

1231


What is rename command in sql?

950


What is the difference between execution of triggers and stored procedures?

1048


What is cursor in pl sql?

1049


What is oracle and pl sql?

1076