g0101_0200.s0176_second_highest_salary.script.sql Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of leetcode-in-java21 Show documentation
Show all versions of leetcode-in-java21 Show documentation
Java-based LeetCode algorithm problem solutions, regularly updated
# Write your MySQL query statement below
# #Medium #Database #SQL_I_Day_4_Union_and_Select
# #2022_07_10_Time_225_ms_(73.10%)_Space_0B_(100.00%)
SELECT ifnull(
(SELECT distinct(Salary)
FROM Employee
ORDER BY Salary DESC
LIMIT 1
OFFSET 1), NULL) SecondHighestSalary;