MIN
functionsupportedCore SQL functionsReturns the minimum value for the records within expr. NULL values are ignored unless all the records are NULL, in which case a NULL value is returned. See also: COUNT , SUM , MAX
Syntax
supportedpartialnot supportednot scored
Aggregate function
MIN( <expr> )
Window function
MIN( <expr> ) [ OVER ( [ PARTITION BY <expr1> ] [ ORDER BY <expr2> [ { ASC | DESC } ] [ NULLS { FIRST | LAST } ] [ <window_frame> ] ] ) ]
Returns
The data type of the returned value is the same as the data type of the input values.
Usage notes
- For compatibility with other systems, you can specify the DISTINCT keyword as an argument for the function, but it does not have any effect.
- If the function is called as a window function, the window can include an optional window_frame. The window_frame (either cumulative or sliding) specifies the subset of rows within the window for which the summed values are returned. If no window_frame is specified, the default is the following cumulative window frame (in accordance with the ANSI standard for window functions): RANGE BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW For more details about window frames, including syntax and examples, see Usage notes for window frames.
Collation Details
- The comparisons follow the collation based on the input arguments’ collations and precedences. - The collation of the result is the same as the collation of the input.