Leetcode Second Highest Salary problem solution YASH PAL, 31 July 202419 January 2026 In this Leetcode Second Highest Salary problem solution, we need to write a SQL query to get the second-highest salary from the Employee table.Leetcode Second Highest Salary problem solution in MYSQL.select MAX(Salary) as "SecondHighestSalary" from Employee where Salary < (select MAX(Salary) from Employee); Second Highest Salary problem solution in TSQL.SELECT ISNULL((SELECT DISTINCT Salary as Salary FROM Employee ORDER BY Salary DESC OFFSET 1 ROWS FETCH NEXT 1 ROW ONLY), NULL) AS SecondHighestSalary Second MYSQL solution.SELECT MAX(Salary) AS SecondHighestSalary FROM Employee WHERE Salary!=(SELECT MAX(Salary)FROM Employee) coding problems solutions Leetcode Problems Solutions Leetcode