Barclays Interview Question

Write a query to find the second-highest salary in a table.

Interview Answer

Anonymous

Sep 24, 2024

SELECT MAX(salary) AS second_highest_salary FROM employees WHERE salary < (SELECT MAX(salary) FROM employees);