Icon MIN

Returns the minimum value of a given expression for all selected rows.

Syntax
MIN(<Expression>)

<Expression> =

Type of:

CHARACTER|CHAR
CHARACTER VARYING|VARCHAR
GUID
BYTE
BYTE VARYING|VARBYTE
BINARY LARGE OBJECT|BLOB
CHARACTER LARGE OBJECT|CLOB
BOOLEAN|BOOL
SMALLINT
INTEGER|INT
BIGINT
FLOAT
DECIMAL|NUMERIC
DATE
TIME
TIMESTAMP
INTERVAL YEAR
INTERVAL YEAR TO MONTH
INTERVAL MONTH
INTERVAL DAY
INTERVAL DAY TO HOUR
INTERVAL DAY TO MINUTE
INTERVAL DAY TO SECOND
INTERVAL DAY TO MSECOND
INTERVAL HOUR
INTERVAL HOUR TO MINUTE
INTERVAL HOUR TO SECOND
INTERVAL HOUR TO MSECOND
INTERVAL MINUTE
INTERVAL MINUTE TO SECOND
INTERVAL MINUTE TO MSECOND
INTERVAL SECOND
INTERVAL SECOND TO MSECOND
INTERVAL MSECOND

Returns
Same as input

Usage
The MIN function returns the minimum value of a given expression for all selected rows. The selected rows can be grouped into logical sub-sets by using the GROUP BY clause of the SELECT statement. Any time the expression is NULL, it is excluded from the minimum calculation.

Examples
SELECT MIN(CAST(TransDateTime AS DATE)) AS TransDate
FROM Transactions
WHERE Amount > 1000.00

SQL 2003 Standard Deviations
This function deviates from the SQL 2003 standard in the following ways:

DeviationDetails
None
Image