0

Currently the raw data I stored in Apache IoTDB is like:

Time 1, Device 1. Measuring point;

Time 1, Device 2. Measuring point;

Time 2, Device 1. Measuring point;

Time 2, Device 2. Measuring point

I want to calculate the aggregated data value of (device 1. measuring point + device 2. measuring point) and (device 1. measuring point + device 2. measuring point) group by Time 1 and Time 2. I checked the official website of IoTDB, and it seems like using "GROUP BY LEVEL" command can only returned one sum value of all data values. How can I write the command to make IoTDB returned separate sum values grouped by Time 1 and Time 2?

how to deal this problem,someone help please?

Thoreau I
  • 15
  • 4

1 Answers1

0

You can try the following command:

select sum(measuring points) from root.db.device1, root.db.device2 group by time([start, end), interval), level=1

You can use sum in Apache IoTDB to combine data in two devices, and use group by time in Apache IoTDB to set certain time interval groups, and level represents to calculate data in different measuring points.

Sihan Liu
  • 128
  • 1
  • 6