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);
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Query for latest salary 2
Lookup Field Update Problem 4
how to update all fields in table in one go? 2
Set Value Macro 2
Finding Median 1
Query 2
how to subtract from field in table 2
staff salary expense database 0

Back
Top