> ## 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.

> Theta Sketch Framework를 사용해 서로 다른 인수 값의 대략적인 개수를 계산합니다.

# uniqTheta

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

도입 버전: v21.6.0

[Theta Sketch Framework](https://datasketches.apache.org/docs/Theta/ThetaSketches.html#theta-sketch-framework)를 사용하여 서로 다른 인수 값의 대략적인 개수를 계산합니다.

<Accordion title="구현 세부 사항">
  이 함수는 집계의 모든 매개변수에 대한 해시를 계산한 다음, 이를 계산에 사용합니다.
  [KMV](https://datasketches.apache.org/docs/Theta/InverseEstimate.html) 알고리즘을 사용하여 서로 다른 인수 값의 개수를 근사합니다.

  4096(2^12)개의 64비트 스케치를 사용합니다.
  상태 크기는 약 41 KB입니다.

  상대 오차는 3.125%(신뢰수준 95%)이며, 자세한 내용은 [상대 오차 표](https://datasketches.apache.org/docs/Theta/ThetaErrorTable.html)를 참조하십시오.
</Accordion>

**구문**

```sql theme={null}
uniqTheta(x[, ...])
```

**인수**

* `x` — 함수는 가변 개수의 인수를 받습니다. [`Tuple(T)`](/ko/reference/data-types/tuple) 또는 [`Array(T)`](/ko/reference/data-types/array) 또는 [`Date`](/ko/reference/data-types/date) 또는 [`DateTime`](/ko/reference/data-types/datetime) 또는 [`String`](/ko/reference/data-types/string) 또는 [`(U)Int*`](/ko/reference/data-types/int-uint) 또는 [`Float*`](/ko/reference/data-types/float) 또는 [`Decimal`](/ko/reference/data-types/decimal)

**반환 값**

서로 다른 인수 값의 대략적인 개수를 나타내는 UInt64 타입의 숫자를 반환합니다. [`UInt64`](/ko/reference/data-types/int-uint)

**예시**

**기본 사용법**

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

INSERT INTO example_theta VALUES
(1, 'A'), (2, 'B'), (3, 'A'), (4, 'C'), (5, 'B'), (6, 'A');

SELECT uniqTheta(category) as theta_unique_categories
FROM example_theta;
```

```response title=Response theme={null}
┌─theta_unique_categories─┐
│                       3 │
└─────────────────────────┘
```

**관련 항목**

* [uniq](/ko/reference/functions/aggregate-functions/uniq)
* [uniqCombined](/ko/reference/functions/aggregate-functions/uniqCombined)
* [uniqCombined64](/ko/reference/functions/aggregate-functions/uniqCombined64)
* [uniqHLL12](/ko/reference/functions/aggregate-functions/uniqHLL12)
* [uniqExact](/ko/reference/functions/aggregate-functions/uniqExact)
