Second Highest Distinct Salary
Medium
Correlated Subqueries
Return the second highest distinct salary, or NULL if there is none.
Table schema
Salaries(id INT PRIMARY KEY, salary INT)Sample data
id | salary
1 | 100
2 | 200
3 | 200
4 | 300
Discussion
No discussions yet.
Shalyam Support
Hi! Ask us anything — we'll reply on WhatsApp or Telegram within 24 hours.