Min Function; Considerations For Min; Operands Of The Expression; Example Of Min - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

MIN Function

MIN is an aggregate function that returns the minimum value within a set of values. The data
type of the result is the same as the data type of the argument.
MIN ([ALL | DISTINCT] expression)
ALL | DISTINCT
specifies whether duplicate values are included in the computation of the minimum of the
expression. The default option is ALL, which causes duplicate values to be included. If
you specify DISTINCT, duplicate values are eliminated before the MIN function is applied.
expression
specifies an expression that determines the values to include in the computation of the
minimum. The expression cannot contain an aggregate function or a subquery. The
DISTINCT clause specifies that the MIN function operates on distinct values from the
one-column table derived from the evaluation of expression. All nulls are eliminated
before the function is applied to the set of values. If the result table is empty, MIN returns
NULL.
See
"Expressions" (page

Considerations for MIN

Operands of the Expression

The expression includes columns from the rows of the SELECT result table—but cannot include
an aggregate function. These expressions are valid:
MIN (SALARY)
MIN (SALARY * 1.1)
MIN (PARTCOST * QTY_ORDERED)

Example of MIN

Display the minimum value in the SALARY column:
SELECT MIN (salary)
FROM persnl.employee;
(EXPR)
-----------
17000.00
--- 1 row(s) selected.
362
SQL Functions and Expressions
208).

Advertisement

Table of Contents
loading

Table of Contents