The MIN scalar function returns the minimum value in a set of values.
The arguments must be compatible. Character-string
arguments are compatible with datetime values. The arguments cannot
be DataLink or XML values.
The result of the function is the minimum
argument value. The result can be null if at least one argument can
be null; the result is the null value if one of the arguments is null.
The selected argument is converted, if necessary, to the attributes of the result. The attributes of the result are determined by all the operands as explained in Rules for result data types.
If a collating sequence other than *HEX is in effect when the statement is executed and the arguments are SBCS data, mixed data, or Unicode data, the weighted values of the strings are compared instead of the actual values. The weighted values are based on the collating sequence.
SELECT MIN(:M1,:M2,:M3) FROM SYSIBM.SYSDUMMY1Returns the value 4.50.
SELECT MIN(:M1,:M2,:M3) FROM SYSIBM.SYSDUMMY1Returns the value 'AA '.