SELECT Salary FROM Employee GROUP BY Salary UNION ALL (SELECT null AS Salary) ORDER BY Salary DESC LIMIT 1 OFFSET 1
Why did you include the statement UNION ALL(.....) . What exactly is this statement doing?
Because the problem requires:
If there is no second highest salary, then the query should return null.
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.