Name

max() — Return the largest value

Common Usage

max( value )

Description

The max() aggregate returns the largest non-NULL value . This is typically used to find the largest numeric value, but the aggregate will sort through all types of data. BLOB values are considered to have the largest value, followed by text values. These are followed by the numeric types (mixed integer values and floating-point values) that are sorted together in their natural order.

If no non-NULL value is found, max() will return a NULL.

There is also a scalar version of max() which takes two or more parameters.

See Also

min() [Scalar SQL Func], max() [Scalar SQL Func]

Get Using SQLite now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.