> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-8c05c8a2.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> 연속된 행 간의 산술 차이를 합산합니다.

# deltaSum

<div id="deltaSum">
  ## deltaSum
</div>

도입 버전: v21.3.0

연속된 행 사이의 산술 차이를 합산합니다.
차이가 음수이면 무시합니다.

<Tip>
  이 함수가 올바르게 작동하려면 원본 데이터가 정렬되어 있어야 합니다.
  이 함수를 [materialized view](/ko/reference/statements/create/view#materialized-view)에서 사용하려면, 대부분 [`deltaSumTimestamp`](/ko/reference/functions/aggregate-functions/deltaSumTimestamp) 함수를 대신 사용하는 것이 좋습니다.
</Tip>

관련 항목:

* [`runningDifference`](/ko/reference/functions/regular-functions/other-functions#runningDifference)

**구문**

```sql theme={null}
deltaSum(x1[, x2, ...])
```

**인수**

* `x1[, x2, ...]` — 하나 이상의 입력 값입니다. [`Integer`](/ko/reference/data-types/int-uint) 또는 [`Float`](/ko/reference/data-types/float)

**반환 값**

입력 값의 증가분에 대한 산술 차이를 반환합니다. [`(U)Int*`](/ko/reference/data-types/int-uint) 또는 [`Float*`](/ko/reference/data-types/float)

**예시**

**양수 차이에 대한 기본 사용법**

```sql title=Query theme={null}
SELECT deltaSum(arrayJoin([1, 2, 3]))
```

```response title=Response theme={null}
┌─deltaSum(arrayJoin([1, 2, 3]))─┐
│                              2 │
└────────────────────────────────┘
```

**음수 차이를 무시한 혼합 값**

```sql title=Query theme={null}
SELECT deltaSum(arrayJoin([1, 2, 3, 0, 3, 4, 2, 3]))
```

```response title=Response theme={null}
┌─deltaSum(arrayJoin([1, 2, 3, 0, 3, 4, 2, 3]))─┐
│                                             7 │
└───────────────────────────────────────────────┘
```

**부동소수점 값**

```sql title=Query theme={null}
SELECT deltaSum(arrayJoin([2.25, 3, 4.5]))
```

```response title=Response theme={null}
┌─deltaSum(arrayJoin([2.25, 3, 4.5]))─┐
│                                2.25 │
└─────────────────────────────────────┘
```

**관련 항목**

* [`runningDifference`](/ko/reference/functions/regular-functions/other-functions#runningDifference)
