SQL - Advanced Query Patterns
Identify the error in this query that attempts to select the top 1 salary per department:
SELECT department, employee, salary, ROW_NUMBER() OVER (PARTITION BY department ORDER BY salary DESC) AS rn FROM employees WHERE rn = 1;