Pergunta de entrevista da empresa Persistent Systems

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

Resposta da entrevista

Sigiloso

1 de abr. de 2024

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