DB2 Version 10.1 for Linux, UNIX, and Windows

MIN aggregate function

The MIN function returns the minimum value in a set of values.

Read syntax diagramSkip visual syntax diagram
           .-ALL------.                  
>>-MIN--(--+----------+--expression--)-------------------------><
           '-DISTINCT-'                  

expression
An expression that returns a value of any built-in data type other than a BLOB, CLOB, DBCLOB, or XML.

The data type, length, and code page of the result are the same as the data type, length, and code page of the argument values. The result is considered to be a derived value and can be null.

The function is applied to the set of values derived from the argument values by the elimination of null values.

If this function is applied to an empty set, the result of the function is a null value. Otherwise, the result is the minimum value in the set.

The specification of DISTINCT has no effect on the result and therefore is not recommended. It is included for compatibility with other relational systems.

Notes

Examples