MIN Function

Description

The MIN function gets the smallest value of expressions of all rows. Only one expression is specified.

For expressions that return character strings, the string that appears earlier in alphabetical order becomes the minimum value; for those that return numbers, the smallest value becomes the minimum value.

Syntax

MIN ( [ { DISTINCT | DISTINCTROW } | UNIQUE | ALL ] expression )

Example

The following example shows how to retrive the minimum number of gold medals that Korea won in the Olympics (demodb).

SELECT MIN(gold) FROM participant WHERE nation_code = 'KOR';

    min(gold)

=============

            7