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

Explain cursor types?

1090


What is lookup table in sql?

1096


what are different types of collation sensitivity? : Sql dba

1125


What is the difference between a query and a report?

1063


What is the difference between view and stored procedure?

1006


Do triggers have restrictions on the usage of large datatypes, such as long and long raw?

1228


Does sqlite need a server?

1097


When you have to use a default "rollback to" savepoint of plvlog?

1254


How is use pl and sql?

1111


Cite the differences between execution of triggers and stored procedures?

1142


What is sql trigger example?

1115


how mysql optimizes distinct? : Sql dba

1128


Explain locks? : Transact sql

1058


How subquery works in sql?

1131


What are all types of user defined functions?

1140