The SQL MAX function returns the largest value within a table or group. In this section, we’ll use the HumanResource.Employee table for our examples:
![Data used for SQL MAX example](https://www.essentialsql.com/wp-content/uploads/2020/01/image-1.png)
Using the data above, MAX calculates the largest SickLeaveHours amount for the entire table:
When used with GROUP BY, MAX returns the largest value within a group. You can see this in this query showing the maximum SickLeaveHours by JobTitle:
Additional SQL MAX Resources
To learn more, check out these useful resources: