uniqExact
Introduced in:v1.1.0
计算不同参数值的精确数量。
Syntax
uniqExact(x[, ...])参数
返回值
返回不同参数值的精确数量,类型为 UInt64。UInt64
示例
基本用法
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 │
└─────────────────────────┘多个参数
SELECT uniqExact(id, category) as exact_unique_combinations
FROM example_data;┌─exact_unique_combinations─┐
│ 6 │
└───────────────────────────┘另请参阅