MAX is an aggregate function that evaluates the maximum of the
expression over a set of values (see
The
DISTINCT qualifier eliminates duplicates. The ALL qualifier retains duplicates.
These qualifiers have no effect in a MAX expression. Only one DISTINCT aggregate
expression per
The Expression can contain multiple column references or expressions, but it cannot contain another aggregate or subquery. It must evaluate to a built-in data type. You can therefore call methods that evaluate to built-in data types. (For example, a method that returns a java.lang.Integer or int evaluates to an INTEGER.) If an expression evaluates to NULL, the aggregate skips that value.
For
CHAR, VARCHAR, and
The resulting data type is the same as the expression on which it operates (it will never overflow).