From 72a02127cddab3b28919aea979ec3f3e79a1d551 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jos=C3=A9=20Antonio=20Chac=C3=B3n=20Guti=C3=A9rrez?= <138903866+joseantoniochacon@users.noreply.github.com> Date: Tue, 1 Oct 2024 15:38:36 -0600 Subject: [PATCH] Time: 215 ms (91.26%), Space: 0B (100.00%) - LeetHub --- 0176-second-highest-salary/0176-second-highest-salary.sql | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 0176-second-highest-salary/0176-second-highest-salary.sql diff --git a/0176-second-highest-salary/0176-second-highest-salary.sql b/0176-second-highest-salary/0176-second-highest-salary.sql new file mode 100644 index 0000000..b987f21 --- /dev/null +++ b/0176-second-highest-salary/0176-second-highest-salary.sql @@ -0,0 +1,6 @@ +# Write your MySQL query statement below + +(SELECT DISTINCT salary AS SecondHighestSalary FROM Employee ORDER BY salary DESC LIMIT 1 OFFSET 1) +UNION +(SELECT NULL AS SecondHighestSalary) +LIMIT 1 \ No newline at end of file