you are at Encyclopedia of SQL >> MAX
MAX(`column_name`)
MAX returns the biggest value of specified column. For column with text values there will be used ASCII code for comparison.Syntax
SELECT MAX(`column_name`)
FROM `table_name`
Example
Display age of the oldest person
name | surname | age |
---|---|---|
Paweł | Kowalski | 3 |
Piotr | Janik | 7 |
Michał | Nowak | 13 |
query
SELECT MAX(`age`)
FROM `people`
result
MAX(`age`) |
---|
13 |