-
-
Notifications
You must be signed in to change notification settings - Fork 299
/
176.cpp
17 lines (17 loc) · 814 Bytes
/
176.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
__________________________________________________________________________________________________
SELECT Salary FROM Employee GROUP BY Salary
UNION ALL (SELECT NULL AS Salary)
ORDER BY Salary DESC LIMIT 1 OFFSET 1;
__________________________________________________________________________________________________
SELECT MAX(Salary) FROM Employee
WHERE Salary NOT IN
(SELECT MAX(Salary) FROM Employee);
__________________________________________________________________________________________________
SELECT MAX(Salary) FROM Employee
Where Salary <
(SELECT MAX(Salary) FROM Employee);
__________________________________________________________________________________________________
SELECT MAX(Salary) FROM Employee E1
WHERE 1 =
(SELECT COUNT(DISTINCT(E2.Salary)) FROM Employee E2
WHERE E2.Salary > E1.Salary);