Skip to content

Latest commit

 

History

History
45 lines (31 loc) · 1.09 KB

File metadata and controls

45 lines (31 loc) · 1.09 KB
description
Returns the maximum value among the non-NULL input expressions.

MAX

Syntax

MAX(expression any primitive) → same as input

  • expression: Input expression.

Examples

{% code title="Aggregate function example" %}

SELECT MAX("total_gas_used") 
FROM eth.recent_blocks

-- EXPR$0
-- 685908.1

{% endcode %}

MAX(expression any primitive) → same as input

  • expression: Input expression.

Examples

{% code title="Window function example" %}

SELECT "transaction_count", 
  MAX("total_gas_used") OVER(PARTITION BY "transaction_count") "max_total_gas_used"
FROM eth.recent_blocks
LIMIT 1

-- block_number, max_gas_used
-- 0.03, 450.5

{% endcode %}

Usage Notes

For information about the data types that are supported in Spice, see Data Types.