SQL - Advanced Query Patterns
Which of the following is the correct syntax to select the top 3 salaries per department using
ROW_NUMBER()?ROW_NUMBER()?ROW_NUMBER() OVER (PARTITION BY department ORDER BY salary DESC) AS rn, numbering rows within each department by descending salary.WHERE rn <= 3, selecting the top 3 rows per department.15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions