select max salary sql code example
Example 1: how to find max and min salary in sql
SELECT MAX(salary), MIN(salary) FROM employees;
Example 2: second max salary in sql
SELECT MAX(SALARY) 'SECOND_MAX' FROM EMPLOYEES
WHERE SALARY <> (SELECT MAX(SALARY) FROM EMPLOYEES);
Example 3: how to find max and min salary in sql
SELECT MAX(SALARY) FROM EMPLOYEES
UNION
SELECT MIN(SALARY) FROM EMPLOYEES;