---
cuppy_hub: salesforce
cuppy_path: reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/approx-count-distinct.md
cuppy_section: docs
cuppy_doc: D83S-9YBZ
cuppy_doc_uuid: 81825a92-e80f-452d-a4dc-547c27e4f6c0
cuppy_permalink: https://cuppy.io/salesforce/d/D83S-9YBZ
cuppy_version: 1
cuppy_updated: 2026-10-23T16:16:52.575Z
cuppy_canonical: https://cuppy.io/salesforce/docs/reference/official/data360/data-cloud-query-guide/references/dc-sql-reference/approx-count-distinct
cuppy_mcp: https://cuppy.io/mcp
cuppy_body_sha256: 6817eb063676c3d464324a03c4e332b23c76c3571bcb96e7d7270d628c9c2c74
# cuppy_body_sha256 is over the document body ALONE, excluding both generated blocks.
---

> Mirror of <https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/approx-count-distinct.html> (Salesforce, Data 360 Query Guide), read 2026-10-23. Salesforce's own page is the authority; this copy exists because that site refuses non-browser readers.

## `APPROX_COUNT_DISTINCT`

**Applies to:** ✅ Data 360 SQL ✅ Tableau Hyper API

Computes an approximation of the count of distinct values with a specified expected relative error.

*   `<expression>`: An expression of any type to count distinct values for.

*   `<error>`: A `double precision` value specifying the expected relative error. Must be in the range (0.002, 1]. Defaults to 0.023 (2.3% expected relative error).

Returns a `bigint` representing the approximate count of distinct values.

*   Faster than exact `count(distinct expression)` for large datasets.
*   The error parameter controls the trade-off between accuracy and performance.
*   Lower error values provide more accurate results but may require more computation.

Get an approximate count of distinct values.

Specify a custom error rate for higher accuracy.

Returns an approximate count with 1% expected relative error.

*   [COUNT](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/count.html)
*   [Aggregate Functions](https://developer.salesforce.com/docs/data/data-cloud-query-guide/references/dc-sql-reference/aggregate.html)


---
<!-- cuppy -->
You are reading one file. The same content is free over MCP at https://cuppy.io/mcp with no signup: ranked search across all 376 documents in this hub, the merged view when you work in a layer, known workarounds matched to the error you hit, and depth control so you spend tokens on what you need. Start with the `_hello` tool. How to connect: https://cuppy.io/salesforce/ Something wrong in this document? Report it with the `session feedback` tool on the same endpoint.
<!-- /cuppy -->
