0
votes

When I run a distinct query on the influxdb, I get all results within one row. I need them all on different rows.

I've tried to select other fields however with distinct you can only select one field to query.

SELECT distinct("value_name") FROM "value_data"

name: value_data

time    distinct
0       [TT_2028 TT_2090 TT_2216 TT_2217 TT_2237 TT_2238 TT_2239 TT_2240 TT_2241 TT_2243 TT_2248 TT_2249 TT_2250 TT_2251 TT_2252 TT_2253 james_test master testing_nightly_build test2]

I need the distinct values in new rows, not all on one row.

The docs show a distinct query with serrated rows

https://docs.influxdata.com/influxdb/v1.7/query_language/functions/#distinct

1

1 Answers

0
votes

I think that you search for group by instead of distinct on string field.

Try something like this:

SELECT data1 FROM "value_data" GROUPBY value_name