uniqExact
Introduced in: v1.1.0
Calculates the exact number of different argument values.
Syntax
uniqExact(x[, ...])Arguments
x— The function takes a variable number of parameters.Tuple(T)orArray(T)orDateorDateTimeorStringor(U)Int*orFloat*orDecimal
Returned value
Returns the exact number of different argument values as a UInt64. UInt64
Examples
Basic usage
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;┌─exact_unique_categories─┐
│ 3 │
└─────────────────────────┘Multiple arguments
SELECT uniqExact(id, category) as exact_unique_combinations
FROM example_data;┌─exact_unique_combinations─┐
│ 6 │
└───────────────────────────┘See Also