A running SUM replays an integer prefix frame.

highlighted = computed this step

Running SUM over a prefix

A running SUM adds the current row to the earlier rows in the same partition.

prefix frame\text{prefix frame}

Replay the prefix

The prefix frame gives 5 rows running sums.

running rows=5\text{running rows}=5

Window-function examples are tiny finite table transforms; SQL dialects, NULL ordering, frames beyond prefix rows, optimizer behavior, performance, and product behavior are out of scope.

Running SUM over a prefix: base rowsidregiondayamount1east152east273west144east235west26 partitionspartitionKeysourceRowsrowCount[east][0, 1, 3]3[west][2, 4]2 window rowssourceRowpartitionKeyorderKeytieBreakerKeyrowNumberrunningSum0[east][1][1]151[east][2][2]2123[east][2][4]3152[west][1][3]144[west][2][5]210 ambiguous tiespartitionKeydeterministicKeysourceRowsnonenonenone window factsfactvaluerowCount5partitionCount2partitionColumnsregionorderColumnsdaytieBreakerColumnsidfunctionsrow_number,running_sumresultRowCount5rejectednorejectionReasonnoneambiguousTieGroups0rowOrderpartition_then_orderframepartition_prefix

Read the sum

Each runningSum cell is recomputed from the visible prefix of integer amount cells.

visible prefix sum\text{visible prefix sum}

Summary

No average, decimal, or hidden frame rule is used here.

integer prefix only\text{integer prefix only}