MAX function [Aggregate]

Function

Returns the maximum expression value found in each group of rows.

Syntax

MAXexpression
| DISTINCT column-name )

Parameters

expression The expression for which the maximum value is to be calculated. This is commonly a column name.

DISTINCT column-name Returns the same as MAXexpression ), and is included for completeness.

Example

The following statement returns the value 138948.000, representing the maximum salary in the Employees table:

SELECT MAX ( Salary )
FROM Employees

Usage

Rows where expression is NULL are ignored. Returns NULL for a group containing no rows.

Standards and compatibility

See also

“MIN function [Aggregate]”

Chapter 2, “Using OLAP” in the System Administration Guide: Volume 2