# APPROXIMATE_COUNT_DISTINCT

## Purpose

This function returns the approximate number of distinct elements (without NULL).

## Syntax

approximate_count_distinct::= ## Usage Notes

• The result is not exact as it is with function COUNT, but it can be computed a lot faster.
• For the calculation, the algorithm HyperLogLog is used internally.

## Example

``SELECT COUNT(DISTINCT customer_id) COUNT_EXACT,APPROXIMATE_COUNT_DISTINCT (customer_id) COUNT_APPRFROM orders WHERE price > 1000;``
###### Result
 COUNT_EXACT COUNT_APPR 10000000 10143194
{"ft_lang_label":"__label__en","ft_lang_prob":0.7773255,"math_prob":0.7740464,"size":519,"snap":"2023-40-2023-50","text_gpt3_token_len":130,"char_repetition_ratio":0.11262136,"word_repetition_ratio":0.0,"special_character_ratio":0.23121387,"punctuation_ratio":0.12328767,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.96368635,"pos_list":[0,1,2],"im_url_duplicate_count":[null,1,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-09-24T10:12:12Z\",\"WARC-Record-ID\":\"<urn:uuid:188f3f15-cefd-4258-8f0c-80387515002d>\",\"Content-Length\":\"33364\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:d46a9ede-2c59-46a9-8b87-407344480ae4>\",\"WARC-Concurrent-To\":\"<urn:uuid:27100b77-43d7-49ef-8637-6cefdbf3c5a3>\",\"WARC-IP-Address\":\"213.95.129.19\",\"WARC-Target-URI\":\"https://docs.exasol.com/saas/sql_references/functions/alphabeticallistfunctions/approximate_count_distinct.htm\",\"WARC-Payload-Digest\":\"sha1:EYDUKT7DU4MFIM3LNBOBBEUSBKRXGS7M\",\"WARC-Block-Digest\":\"sha1:HXWAUF6VD6CH4TNK2VY72MZQRD5EA3DX\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-40/CC-MAIN-2023-40_segments_1695233506632.31_warc_CC-MAIN-20230924091344-20230924121344-00154.warc.gz\"}"}