mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-07 08:03:15 +00:00
422 B
422 B
toc_priority |
---|
141 |
deltaSum
语法
deltaSum(value)
计算连续行之间的差值和。如果差值为负,则忽略。
value
必须是整型或浮点类型。
示例:
select deltaSum(arrayJoin([1, 2, 3])); -- => 2
select deltaSum(arrayJoin([1, 2, 3, 0, 3, 4, 2, 3])); -- => 7
select deltaSum(arrayJoin([2.25, 3, 4.5])); -- => 2.25