Use desktop for interactive SQL sandbox
Tip: Press Alt+Enter to run SQL

SQL Output

2. Second Highest Salary Per Department
Public
Use window functions and DENSE_RANK to find the Nth-ranked value per group while handling ties correctly.
jrz1977
PostgreSQL
Created Jan 23, 2026
Updated Jan 24, 2026
1Notes Notes
2SQL SQL
1 SQL 1 Notes
Switch to a SQL tab and press Alt+Enter to run queries
2. Second Highest Salary Per Department Updated 1/24/26, 11:25 PM
Notes SQL
Alt+Enter to run