How to find the 2nd max salary?

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?
 
K

Ken Snell \(MVP\)

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


Top