SQL: Second Highest Salary
Medium
SQL — Subqueries
SQL
Subquery
LIMIT
Find the second highest salary.
Constraints
Write standard SQL (MySQL 8.0 compatible).
Examples
Example 1:
Input: salary
100
200
300
Output:
Example 2:
Input: salary
100
200
300
Output:
Hints
Use subquery or LIMIT/OFFSET.
Tests:
Runtime:
Memory:
Test
Input:
Expected:
Got:
Click Run Code to test against sample cases, or Submit to test against all cases.
▲ Console