Persistent Systems Interview Question

Write a SQL query to find the second-highest salary from the Employees table without using the LIMIT keyword.

Interview Answer

Anonymous

Apr 1, 2024

SELECT MAX(Salary) AS SecondHighestSalary FROM Employees WHERE Salary < (SELECT MAX(Salary) FROM Employees);