Solutin#1
# Write your MySQL query statement below
SELECT MAX(Salary) AS SecondHighestSalary
FROM Employee
WHERE Salary < (SELECT MAX(Salary) FROM Employee)
#Using max() will return a NULL
#if the value doesn't exist.
#So there is no need to UNION a NULL.
#Of course, if the second highest value is guaranteed to exist, using LIMIT 1,1 will be the best answer.
Solution#2
SELECT (SELECT DISTINCT Salary
FROM Employee
ORDER BY Salary DESC LIMIT 1 OFFSET 1
) AS SecondHighestSalary
#利用了Limit 1,同時在外圈加一圈選擇滿足了Null的情況