Find the Nth distinct highest salary.
sqlCopySELECT DISTINCT salary FROM employees ORDER BY salary DESC LIMIT 1 OFFSET N-1;
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.