Docs›Reference›Functions›Aggregate›count_distinctcount_distinctOn this pageSyntaxReturnsExamplesCounts distinct non-NULL input values exactly. Syntax Copycount_distinct( <expr> ) Returns Returns int. Examples CopyVALUES ('a'), ('b'), ('a'), ('c') AGGREGATE count_distinct($0);