How to find second maximum salary from a table.
how we can find second maximum salary from the table like table name is customer.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jun 8, 2015, 1:54 AM EDT
1-SELECT MAX(Salary) FROM Employee WHERE Salary NOT IN (SELECT MAX(Salary) FROM Employee )2-select MAX(Salary) from Employee WHERE Salary <> (select MAX(Salary) from Employee )select max(salary) from emptable where salary (select max(salary) from emptable);4- SELECT * FROM ( SELECT [Salary],(DENSE_RANK() OVER (ORDER BY [Salary] DESC)) AS rnk FROM [Table1] GROUP BY [Num] ) AS A WHERE A.rnk = 2Guest UserRank #816 · 2.8K reputationPosted Jun 8, 2015, 1:34 AM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Jun 8, 2015, 1:36 AM EDT
Guest UserRank #816 · 2.8K reputationPosted Jun 8, 2015, 1:58 AM EDT
Upendra Pratap ShahiRank #329 · 7.5K reputationPosted Jun 8, 2015, 2:07 AM EDT
Pankaj Kumar ChoudharyRank #80 · 24.4K reputationPosted Jun 8, 2015, 4:52 AM EDT