Skip to main content
Calculate the sum of the values within the requested window. The SUM function works with numeric values and ignores NULL values. For more information on usage, please refer to Window Functions.

Syntax

Parameters

Return Types

NUMERIC When DISTINCT is specified, duplicate values from <expression> are removed before calculating the sum.

Example

The example below shows each player’s score alongside the total score for their level. Unlike a regular SUM() aggregation, the window function keeps one row per player while computing the per-level total.

Rows: 5Execution time: 1.52ms