How to find the 2nd max salary?

  • Thread starter Thread starter Jon
  • Start date Start date
J

Jon

I have a table for salary of employees and it has 4 fields:

EmpID, Name, Salary and Major.

My question is how to show the 2nd max salary in this table by using query?
 
One way:

SELECT Max(Salary) AS SecondMaxSalary
FROM TableName
WHERE Salary <
(SELECT Max(T.Salary) AS MaxSalary
FROM TableName AS T);
 
Back
Top