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 calcuate the second highest salary of he employee

Answer Posted / jitendra

To get nth highest Salary, use below query

SELECT TOP 1 salary
FROM (
SELECT TOP nth salary
FROM Emp
ORDER BY salary DESC
) TmpTable
ORDER BY salary ASC

Replace nth with your number like second highest=2 4th=4 etc

Is This Answer Correct ?    0 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is thread join () in threading?

994


how to fetch alternate records from a table? : Sql dba

1085


What are pl sql data types?

993


Why we use pl sql?

942


How do I run a sql trace?

946


How can you maintain the integrity of your database on instances where deleting an element in a table result in the deletion of the element(s) within another table?

1116


What are the types of sql commands?

1072


what are the differences between require and include, include_once and require_once? : Sql dba

1004


Can a foreign key be a duplicate?

895


How to run pl/sql statements in sql*plus?

1059


Do ddl statements need commit?

957


What is sql injection vulnerability?

925


Explain how exception handling is done in advance pl/sql?

985


How to display Row Number with Records in Oracle SQL Plus?

1024


What are the types of keys?

980