MAX

Function MAX is also found in the following categories: Window functions.

Syntax

MAX( value )
MAX( value
     [ FIXED ... | INCLUDE ... | EXCLUDE ... ]
     [ BEFORE FILTER BY ... ]
   )

More info:

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:

  • valueBoolean | Date | Datetime | Fractional number | Integer | String | UUID

Return type: Same type as (value)

Example

MAX([Profit])

Data source support

ClickHouse 19.13, Microsoft SQL Server 2017 (14.0), MySQL 5.6, PostgreSQL 9.3.

Previous
Next