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 are string data types? : Sql dba

1053


Is merge a dml statement?

988


What is date functions?

1037


What is lookup table in sql?

1057


What is sql*plus?

1085


Which table is left in left join?

1027


how to use like conditions? : Sql dba

1119


Can we insert in sql function?

1097


What is the starting oracle error number?

1067


What is data type in sql?

975


What is a unique constraint?

1086


How can we connect an Android App to an Oracle database and use the PL/SQL procedural code?

1152


how can we know the number of days between two given dates using mysql? : Sql dba

1053


Is sql procedural language?

974


What is the difference between between and in condition operators?

1017