MAX (window)
Function MAX
is also available as an aggregate function.
Syntax
MAX( value [ TOTAL | WITHIN ... | AMONG ... ] [ BEFORE FILTER BY ... ] )
Description
Returns the maximum value.
If value
:
- number — Returns the largest number.
- date — Returns the latest date.
- string — Returns the last value in the alphabetic order.
Argument types:
value
—Boolean | Date | Datetime | Number | String | UUID
Return type: Same type as (value
)
Examples
MAX([Profit] TOTAL)
MAX([Profit] WITHIN [Date])
MAX([Profit] AMONG [Date])
Data source support
Materialized Dataset
, ClickHouse 1.1
, Microsoft SQL Server 2017 (14.0)
, MySQL 5.6
, Oracle Database 12c (12.1)
, PostgreSQL 9.3
.