⌘K
Flycodx

Find the Second Highest Salary

Find the Second Highest Salary

EasySQL0% accepted

Given an Employee table with columns Id and Salary, write a SQL query to find the second highest distinct salary. Return NULL if no second highest salary exists.

Approach

Find second highest salary; return NULL if not exists.

Input

Employee: [(1,100),(2,200),(3,300)]

Output

200

Scenarios & Expected Answers

Sign in to continue

Create a free account to view answers and mark progress.

  • Free forever — no credit card
  • Theory Q&A with detailed answers
  • Points, streaks & leaderboards
Auto Save On