The MySQL MAX()
function is an aggregate function that returns the maximum value from an expression.
Typically, the expression would be a range of values returned as separate rows in a column, and you can use this function to find the maximum value from the returned rows. If there are no matching rows, MAX()
returns NULL
.
For example, you can use this function to find out which city has the largest population out of a list of cities.