count_distinct#
- count_distinct(input)[source]#
Counts the number of distinct, non-null elements in the input expression.
Example:
SQL#SELECT count(distinct x) FROM tbl
Input#╭───────╮ │ x │ │ --- │ │ Int64 │ ╞═══════╡ │ 100 │ ├╌╌╌╌╌╌╌┤ │ 200 │ ├╌╌╌╌╌╌╌┤ │ 100 │ ├╌╌╌╌╌╌╌┤ │ null │ ╰───────╯ (Showing first 3 of 3 rows)
Output#╭───────╮ │ x │ │ --- │ │ Int64 │ ╞═══════╡ │ 2 │ ╰───────╯ (Showing first 1 of 1 rows)