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

1 Apr 2024

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