# MAX

An aggregate function returning the highest non-NULL value.

## What is **MAX** in a relational database?

**MAX** — An aggregate function returning the highest non-NULL value.

```sql
SELECT customer_id, MAX(total_amount) AS largest_total
FROM purchase_order
GROUP BY customer_id;
```

Level: Apprentice · [More Database terms at this level](https://www.ask-codey.com/glossary/subjects/database/apprentice)

Updated: September 28, 2026

## In other subjects

- [max in HTML](https://www.ask-codey.com/glossary/max-html)

Source: https://www.ask-codey.com/glossary/max
