The MIN column function returns the minimum value in a set of values in a group.
The MIN scalar function returns the minimum value in a set of values. There must be two or more arguments, and the arguments must be compatible. The arguments cannot be DataLink values.
Example column:
Using the EMPLOYEE table, set the host variable COMM_SPREAD (decimal(7,2)) to the difference between the maximum and minimum commission (COMM) for the members of department (WORKDEPT) 'D11'.
SELECT MAX(COMM) - MIN(COMM) INTO :COMM_SPREAD FROM EMPLOYEE WHERE WORKDEPT = 'D11'
Results in COMM_SPREAD being set to 1118 (that is, 2580 - 1462) when using the sample table.
Example scalar:
Assume column M1 has a value of 5.5, column M2 has a value of 4.5, and column M3 has a value of 6.25.
MIN(M1,M2,M3)
Returns the value 4.50.