On this page

    Categories: Aggregate

    APPROX_COUNT_DISTINCT

    Returns the approximate number of rows that contain distinct values in a column. Ignores rows that contain a null value for the column.

    Syntax

    APPROX_COUNT_DISTINCT(column_name ANY) → INT or BIGINT

    • column_name: The column can contain values of any data type.

    Examples

    SELECT APPROX_COUNT_DISTINCT(business_id) AS "number_of_businesses" FROM "restaurant_reviews.parquet";
    -- 62