Skip to content

Latest commit

 

History

History
55 lines (42 loc) · 2.97 KB

aggregate_analytic_functions.md

File metadata and controls

55 lines (42 loc) · 2.97 KB

Aggregate analytic functions

The following sections describe the aggregate analytic functions that ZetaSQL supports. For an explanation of how analytic functions work, see Analytic Function Concepts. For an explanation of how aggregate analytic functions work, see Aggregate Analytic Function Concepts.

ZetaSQL supports the following aggregate functions as analytic functions:

OVER clause requirements:

  • PARTITION BY: Optional.
  • ORDER BY: Optional. Disallowed if DISTINCT is present.
  • window_frame_clause: Optional. Disallowed if DISTINCT is present.

Example:

COUNT(*) OVER (ROWS UNBOUNDED PRECEDING)
SUM(DISTINCT x) OVER ()