Docs

v2.0

distinct() function

The distinct() function returns the unique values for a given column. null is considered its own distinct value if it is present.

Function type: Selector
Output data type: Object

distinct(column: "host")

Parameters

column

Column on which to track unique values.

Data type: string

Examples

from(bucket: "telegraf/autogen")
	|> range(start: -5m)
	|> filter(fn: (r) => r._measurement == "cpu")
	|> distinct(column: "host")

DISTINCT()


Bug Reports and Feedback

Thank you for being willing to help test InfluxDB v2.0 alpha! Feedback and bug reports are welcome and encouraged both for InfluxDB and this documentation.

Submit feedback in the InfluxData Community