AlbinoRhino
AlbinoRhino

Reputation: 497

How to query influx for all distinct values of a field on a measurement

I want to query an influx measurement, and get all of the distinct values for a specific field.

this would work similarly to

SHOW TAG VALUES FROM measurement WITH KEY = "key_name"

but instead of tags, I just want fields

Upvotes: 0

Views: 1408

Answers (1)

AlbinoRhino
AlbinoRhino

Reputation: 497

The proper query would be

SELECT distinct("field_name") FROM measurement_name

be aware that queries against fields will often take orders of magnitude longer than queries against tags.

Upvotes: 0

Related Questions