Skip to content

Commit 6ddbcdb

Browse files
authored
Update second-highest-salary.sql
1 parent 141e4ba commit 6ddbcdb

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MySQL/second-highest-salary.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
# For example, given the above Employee table, the second highest salary is 200. If there is no second highest salary, then the query should return null.
1414
#
1515
# Write your MySQL query statement below
16-
select (SELECT MAX(Salary) FROM Employee WHERE Salary NOT IN (SELECT MAX(Salary) FROM Employee)) SecondHighestSalary;
16+
SELECT (SELECT MAX(Salary) FROM Employee WHERE Salary NOT IN (SELECT MAX(Salary) FROM Employee)) SecondHighestSalary;
1717
# or
1818
SELECT (SELECT Salary FROM Employee GROUP BY Salary ORDER BY Salary DESC LIMIT 1,1) SecondHighestSalary;

0 commit comments

Comments
 (0)