Thoreau I
Thoreau I

Reputation: 130

How to conveniently calculate the average value of all devices of a certain kind every certain minute in Apache IoTDB?

If there is a need to calculate the average temperature of all devices every 5 minutes, how to implement this query statement in Apache IoTDB? Our devices are divided into different kinds, and our need is, for example, to get the average value of air conditioning type equipment every 5 minutes. Our time series looks like this: root.xxxx.aircondition.xx.xx.device_1.temperature. It is impossible for us to create a new continuous query for each equipment, so I want to ask for a more convenient query solution.

Upvotes: 0

Views: 20

Answers (1)

BeHappy
BeHappy

Reputation: 134

If your time series are with the same name structure in Apache IoTDB (like you mentioned in the question), try to use select avg temperature from root.xxxx.aircondition.xx.xx.* group by time range to obtain the average value you want.

Upvotes: 1

Related Questions