Watch the 7.3 Webinar On-Demand
This new release brings updates to Universal Storage, query optimization, and usability that you won’t want to miss.

MIN

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

Info

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

Syntax

MIN ( expression )

Arguments

  • expression: any expression. This may be a column name, the result of another function, or a math operation.

Return Type

The lowest value, in the type of the input.

Examples

SELECT MIN(person_id) FROM people;
+----------------+
| MIN(person_id) |
+----------------+
|              0 |
+----------------+

SELECT MIN(first_name) FROM people;
+-----------------+
| MIN(first_name) |
+-----------------+
| Aahab           |
+-----------------+