MAX is an aggregate function that returns the largest non-NULL value from a set of values.
Maximum values help identify the highest salary, largest transaction, latest date, or highest sales value.
Find the highest employee salary.
SELECT
MAX(Salary) AS MaximumSalary
FROM Employees;
MAX is commonly used in financial analysis, sales reporting, performance analysis, and date-based reporting.
- MAX returns the largest value.
- NULL values are generally ignored.
- It works with numeric values.
- It can work with dates and comparable values.
- It can be combined with GROUP BY.
What does MAX do?
MAX returns the largest non-NULL value from the selected expression.
Can MAX find the latest date?
Yes. MAX on a date column returns the latest date.