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

> 합계를 계산합니다. 숫자에만 사용할 수 있습니다.

# sum

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

출시 버전: v1.1.0

숫자 값의 합을 계산합니다.

**구문**

```sql theme={null}
sum(num)
```

**인수**

* `num` — 숫자 값으로 이루어진 컬럼. [`(U)Int*`](/ko/reference/data-types/int-uint) 또는 [`Float*`](/ko/reference/data-types/float) 또는 [`Decimal*`](/ko/reference/data-types/decimal)

**반환 값**

값의 합계를 반환합니다. [`(U)Int*`](/ko/reference/data-types/int-uint) 또는 [`Float*`](/ko/reference/data-types/float) 또는 [`Decimal*`](/ko/reference/data-types/decimal)

**예시**

**직원 급여 합계 계산**

```sql title=Query theme={null}
CREATE TABLE employees
(
    id UInt32,
    name String,
    salary UInt32
)
ENGINE = Memory;

INSERT INTO employees VALUES
    (87432, 'John Smith', 45680),
    (59018, 'Jane Smith', 72350),
    (20376, 'Ivan Ivanovich', 58900),
    (71245, 'Anastasia Ivanovna', 89210);

SELECT sum(salary) FROM employees;
```

```response title=Response theme={null}
┌─sum(salary)─┐
│      266140 │
└─────────────┘
```
