Skip to main content
Returns the maximum value in its argument. NULL values are ignored. If all inputs are NULL, MAX returns NULL.

Syntax

Parameters

Return Types

Same as input type

Examples

The tournaments table contains the following data:

Rows: 5Execution time: 6.00ms

The following example finds the largest prize amount in the tournaments table:

Rows: 1Execution time: 5.86ms

MAX also works on text columns, returning the lexicographically largest value. The following example finds the tournament name that comes last alphabetically:

Rows: 1Execution time: 5.94ms