0
votes

Our measurement structure looks like this: timeStamp - sensor(tag) - value(field).

To query the values of more than one tag, the documentation provides the following: SELECT value FROM measurement WHERE sensor=sensor_1 OR sensor=sensor_2 OR ... Which results a single column of values.

But how to divide the result values by the different sensors(tags) in multiple columns, maybe something like this: SELECT value.sensor_1, value.sensor_2 FROM measurement ideally this should be applicable with influxdb-java.

1

1 Answers

0
votes

Don't use SELECT, but GROUP BY clause:

GROUP BY sensor

The result will be row per sensor.

Doc: https://docs.influxdata.com/influxdb/v1.6/query_language/data_exploration/#the-group-by-clause