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 date and time functions in mysql? : Sql dba

1033


what are the differences between public, private, protected, static, transient, final and volatile? : Sql dba

1102


explain the difference between bool, tinyint and bit. : Sql dba

1067


What does t sql mean?

1008


What jobs use sql?

1041


Does view store data in sql?

1044


Explain the difference between rename and alias?

1075


What is a primary key? Explain

1031


what is the command line end user interface - mysql? : Sql dba

1042


Is sql easier than java?

1078


What is a pdo connection?

1125


Determine if oracle date is on a weekend?

1097


How to change a value of the field ‘salary’ as 7500 for an employee_name ‘john’ in a table employee_details?

1501


Enlist the characteristics of pl/sql?

1850


What is auto increment?

1055