Documentation IndexFetch the complete documentation index at: /llms.txtUse this file to discover all available pages before exploring further.
Fetch the complete documentation index at: /llms.txt
Use this file to discover all available pages before exploring further.
ClickHouse launches Claude-powered Agents and House Mates partner program at Open House 2026 Read more →
计算输入值的滑动和。
groupArrayMovingSum(numbers_for_summing) groupArrayMovingSum(window_size)(numbers_for_summing)
window_size
UInt64
numbers_for_summing
(U)Int*
Float*
Decimal
Array
CREATE TABLE t ( `int` UInt8, `float` Float32, `dec` Decimal32(2) ) ENGINE = Memory; INSERT INTO t VALUES (1, 1.1, 1.10), (2, 2.2, 2.20), (4, 4.4, 4.40), (7, 7.77, 7.77); SELECT groupArrayMovingSum(int) AS I, groupArrayMovingSum(float) AS F, groupArrayMovingSum(dec) AS D FROM t;
┌─I──────────┬─F───────────────────────────────┬─D──────────────────────┐ │ [1,3,7,14] │ [1.1,3.3000002,7.7000003,15.47] │ [1.10,3.30,7.70,15.47] │ └────────────┴─────────────────────────────────┴────────────────────────┘
SELECT groupArrayMovingSum(2)(int) AS I, groupArrayMovingSum(2)(float) AS F, groupArrayMovingSum(2)(dec) AS D FROM t;
┌─I──────────┬─F───────────────────────────────┬─D──────────────────────┐ │ [1,3,6,11] │ [1.1,3.3000002,6.6000004,12.17] │ [1.10,3.30,6.60,12.17] │ └────────────┴─────────────────────────────────┴────────────────────────┘
此页面对您有帮助吗?