Write a query for the second-highest distinct non-NULL salary. What happens if it does not exist?
Rank distinct salary values in descending order with DENSE_RANK and select rank 2. Filtering NULL before ranking avoids dialect-dependent placement of NULL salaries. DISTINCT on the final selected sal...