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

How to generate a salary slip like jan 1000 1000 feb 1000 2000 ... dec 1000 12000

2123


How do you modify a trigger?

893


How is data stored in sql?

1019


Can cursors be part of a trigger body?

1599


Is grant a ddl statement?

867


how to get a list of columns in an existing table? : Sql dba

928


What is sql and how does it work?

1115


What is the purpose of cursors in pl/sql?

1097


What is count * in sql?

959


What is nvarchar max in sql?

976


What is the purpose of my sql?

919


What is meaning of <> in sql?

1034


What is the difference between the conventional and direct path loader? : aql loader

1127


how to calculate the difference between two dates? : Sql dba

1017


how can we destroy the cookie? : Sql dba

973