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...

how to find the second highest salary from emp table?

Answer Posted / nalini

Follow the following Query, You get the second highest
salary.
SQL> Select level,Max(sal) from emp
Where level=&level connect by prior sal>sal
group by level;
SQL> Enter the level No=2 (Here enter 2 manually)

Then you will get the 2nd highest salary.
If you want 3rd Highest salary, then enter level no=3.

Is This Answer Correct ?    208 Yes 105 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the rollback statement?

1001


what are the limitations of identity column? : Transact sql

1104


How to Execute a Package in PL/SQL.?

1194


Can a table contain multiple foreign key’s?

989


How can I tell if sql is running?

1060


Can one improve the performance of sql*loader? : aql loader

1044


Does sql profiler affect performance?

987


How to create an array in pl/sql?

1062


What is sql indexing?

1007


What is difference between primary and secondary key?

1021


Explain two easy sql optimizations.

1008


How do I view a sql trace file?

1021


What is the purpose of the sql select top clause?

1102


Explain ddl statements in pl/sql?

1007


Can a trigger call a stored procedure?

1064