Skip to content

Commit 97fb7b3

Browse files
authored
Create 176-second-highest-salary.sql
1 parent f026df3 commit 97fb7b3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

176-second-highest-salary.sql

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Write your MySQL query statement below
2+
SELECT max(Salary) AS SecondHighestSalary
3+
FROM Employee
4+
WHERE Salary < (SELECT max(Salary) FROM Employee)
5+
6+
# another
7+
8+
# Write your MySQL query statement below
9+
SELECT IFNULL(
10+
(SELECT DISTINCT Salary
11+
FROM Employee
12+
ORDER BY Salary DESC
13+
LIMIT 1 OFFSET 1)
14+
, NULL) AS SecondHighestSalary

0 commit comments

Comments
 (0)