Search
⌘K

Leetcode 3338. Second Highest Salary II

Given an Employee table of salaries, write an SQL query to return the second-highest distinct salary (or NULL if fewer than two distinct salaries), correctly handling duplicate salary values and edge cases. This requires selecting the second maximum distinct value—typically approached with ranking functions or subqueries.


Question Timeline

See when this question was last asked and where, including any notes left by other candidates.

Comments

Your account is free and you can post anonymously if you choose.