Domanda di colloquio di Persistent Systems

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

Risposta di colloquio

Anonimo

1 apr 2024

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