MIN(expression)

Description: Returns the minimum value of expression. Generally used with GROUP BY clause, but otherwise operates on all rows returned.

May take a string argument, returning the maximum string value.

Example:

SELECT city_name, MIN(temperature)
  FROM weather
  GROUP BY city_name

See also: MAX()

Get Sams Teach Yourself MySQL in 21 Days, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.