Suppose that you are given the following simple database table called Employee that has 2 columns named Employee ID and Salary:
Employee Employee ID S
Find Max salary of an employee
SELECT MAX(Salary) FROM Employee
Find Second Highest Salary
SELECT MAX(Salary) FROM Employee Where Salary Not In (Select MAX(Salary) FROM Employee)
OR
SELECT MAX(Salary) FROM Employee WHERE Salary <> (SELECT MAX(Salary) FROM Employee )