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

> Calculates the exact number of different argument values.

# uniqExact

<h2 id="uniqExact">
  uniqExact
</h2>

Introduced in: v1.1.0

Calculates the exact number of different argument values.

<Warning>
  The `uniqExact` function uses more memory than `uniq`, because the size of the state has unbounded growth as the number of different values increases.
  Use the `uniqExact` function if you absolutely need an exact result.
  Otherwise use the [`uniq`](/reference/functions/aggregate-functions/uniq) function.
</Warning>

**Syntax**

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

**Arguments**

* `x` — The function takes a variable number of parameters. [`Tuple(T)`](/reference/data-types/tuple) or [`Array(T)`](/reference/data-types/array) or [`Date`](/reference/data-types/date) or [`DateTime`](/reference/data-types/datetime) or [`String`](/reference/data-types/string) or [`(U)Int*`](/reference/data-types/int-uint) or [`Float*`](/reference/data-types/float) or [`Decimal`](/reference/data-types/decimal)

**Returned value**

Returns the exact number of different argument values as a UInt64. [`UInt64`](/reference/data-types/int-uint)

**Examples**

**Basic usage**

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

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

SELECT uniqExact(category) as exact_unique_categories
FROM example_data;
```

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

**Multiple arguments**

```sql title=Query theme={null}
SELECT uniqExact(id, category) as exact_unique_combinations
FROM example_data;
```

```response title=Response theme={null}
┌─exact_unique_combinations─┐
│                         6 │
└───────────────────────────┘
```

**See Also**

* [uniq](/reference/functions/aggregate-functions/uniq)
* [uniqCombined](/reference/functions/aggregate-functions/uniqCombined)
* [uniqHLL12](/reference/functions/aggregate-functions/uniqHLL12)
* [uniqTheta](/reference/functions/aggregate-functions/uniqthetasketch)
