mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-24 08:32:02 +00:00
58599ba220
remove aggregate from deltasum.
1.5 KiB
1.5 KiB
toc_priority |
---|
141 |
deltaSum
Sums the arithmetic difference between consecutive rows. If the difference is negative, it is ignored.
Syntax
deltaSum(value)
Arguments
Returned value
- A gained arithmetic difference of the
Integer
orFloat
type.
Examples
Query:
SELECT deltaSum(arrayJoin([1, 2, 3]));
Result:
┌─deltaSum(arrayJoin([1, 2, 3]))─┐
│ 2 │
└────────────────────────────────┘
Query:
SELECT deltaSum(arrayJoin([1, 2, 3, 0, 3, 4, 2, 3]));
Result:
┌─deltaSum(arrayJoin([1, 2, 3, 0, 3, 4, 2, 3]))─┐
│ 7 │
└───────────────────────────────────────────────┘
Query:
SELECT deltaSum(arrayJoin([2.25, 3, 4.5]));
Result:
┌─deltaSum(arrayJoin([2.25, 3, 4.5]))─┐
│ 2.25 │
└─────────────────────────────────────┘