Files
doris/docs/en/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 en

APPROX_COUNT_DISTINCT

Description

Syntax

APPROX_COUNT_DISTINCT (expr)

Returns an approximate aggregation function similar to the result of COUNT (DISTINCT col).

It combines COUNT and DISTINCT faster and uses fixed-size memory, so less memory can be used for columns with high cardinality.

example

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

keyword

APPROX_COUNT_DISTINCT