MAX

noun

say it: “MAKS” /mæks/

A SQL aggregate function that returns the highest value in a column.

What is MAX in a relational database?

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

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

In a sentence

  • “MAX(UnitPrice) found the most expensive product.”

Level: Apprentice · More SQL terms at this level

Updated

In other subjects