Retrieve Nth Highest Distinct Employee Salary

Find the Nth distinct highest salary.

sql

SELECT DISTINCT salary FROM employees ORDER BY salary DESC LIMIT 1 OFFSET N-1;

This query retrieves the Nth highest distinct salary by sorting the unique salary values in descending order and skipping the first N-1 records.

PromptDB can make mistakes. Please double-check responses.