Max/Maximum Function; Considerations For Max/Maximum; Example Of Max/Maximum - HP Neoview SQL Reference Manual

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

MAX/MAXIMUM Function

MAX is an aggregate function that returns the maximum value within a set of values. MAXIMUM
is the equivalent of MAX wherever the function name MAX appears within a statement. The
data type of the result is the same as the data type of the argument.
MAX | MAXIMUM ([ALL | DISTINCT] expression)
ALL | DISTINCT
specifies whether duplicate values are included in the computation of the maximum 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 MAX/MAXIMUM function
is applied.
expression
specifies an expression that determines the values to include in the computation of the
maximum. The expression cannot contain an aggregate function or a subquery. The
DISTINCT clause specifies that the MAX/MAXIMUM 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,
MAX/MAXIMUM returns NULL.
See
"Expressions" (page

Considerations for MAX/MAXIMUM

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:
MAX (SALARY)
MAX (SALARY * 1.1)
MAX (PARTCOST * QTY_ORDERED)

Example of MAX/MAXIMUM

Display the maximum value in the SALARY column:
SELECT MAX (salary)
FROM persnl.employee;
(EXPR)
-----------
175500.00
--- 1 row(s) selected.
255).
MAX/MAXIMUM Function
419

Advertisement

Table of Contents
loading

Table of Contents