SELECT MAX(Salary) as SecondHighestSalary
FROM (SELECT E1.Salary
FROM Employee as E1 JOIN Employee as E2
ON E1.Salary < E2.Salary
GROUP BY E1.Id HAVING COUNT(E2.Id) = 1
) AS SecondHighestSalary
ORDER BY Salary DESC LIMIT 1;
Looks like your connection to LeetCode Discuss was lost, please wait while we try to reconnect.