Files
doris/docs/zh-CN/sql-reference/sql-functions/aggregate-functions/approx_count_distinct.md
ZhangYu0123 1d9b3aeee7 [Doc] Repair document format (#4336)
The error format '##keyword' in a lot of docs. This pr is to repair document format. #4335
2020-08-13 23:39:41 +08:00

1.4 KiB

title, language
title language
APPROX_COUNT_DISTINCT zh-CN

APPROX_COUNT_DISTINCT

description

Syntax

APPROX_COUNT_DISTINCT(expr)

返回类似于 COUNT(DISTINCT col) 结果的近似值聚合函数。

它比 COUNT 和 DISTINCT 组合的速度更快,并使用固定大小的内存,因此对于高基数的列可以使用更少的内存。

example

MySQL > select approx_count_distinct(query_id) from log_statis group by datetime;
+-----------------+
| approx_count_distinct(`query_id`) |
+-----------------+
| 17721           |
+-----------------+

keyword

APPROX_COUNT_DISTINCT