Product Solutions Support
Try MemSQL

MAX

Aggregate function. Returns the highest value observed in all rows in an aggregation. “Highest” is determined by the collation rules of the data passed in.

Info

This aggregate function is not to be confused with GREATEST, which is a non-aggregate function returning the highest value in its list of arguments.

MAX ( expression )

Arguments

Return Type

The highest value, in the type of the input.

Examples

memsql> select max(person_id) from people;
+----------------+
| max(person_id) |
+----------------+
|           6336 |
+----------------+

memsql> select max(first_name) from people;
+-----------------+
| max(first_name) |
+-----------------+
| Zula            |
+-----------------+
Was this article useful?