Function Reference

MIN

Returns the smallest value of the expression in a group of rows.

PostgreSQL 17.5
MIN(expression)

Parameters

expression
Expression: a number, string or date

Return value

A value of the same type as expression; strings are compared alphabetically, NULLs are ignored, NULL for an empty set

Examples

Lowest price

PostgreSQL 17.5
SELECT MIN(unit_price)
FROM Payments;
min
7

First name alphabetically

PostgreSQL 17.5
SELECT MIN(member_name) AS first_name_alphabetically
FROM FamilyMembers;
first_name_alphabetically
Andie Quincey

Details

The function works with numbers, strings and dates, but not with boolean: for logical values there are BOOL_AND and BOOL_OR.

See also

Where to learn