2

I want to get the average value of the specified data field values in each interval, for example, the sum of data fields in each hour in a 24 hour day. I tried the following methods to get the data, but they failed to meet my needs. How do I get the desired result?

gs[public]> tql lctime select * where timestamp < TIMESTAMPADD(HOUR, TIMESTAMP('2022-12-28T00:00:00Z'), -1) and timestamp > TIMESTAMPADD(HOUR, TIMESTAMP('2022-12-27T00:00:00Z'), -1)
362 results. (0 ms)
gs[public]> get 10
timestamp,data,temperature
2022-12-27T02:08:08.055Z,359.0,359.0
2022-12-27T02:34:00.105Z,359.0,359.0
2022-12-27T02:34:56.511Z,0.0,0.0
2022-12-27T02:35:56.511Z,1.0,1.0
2022-12-27T02:36:56.511Z,2.0,2.0
2022-12-27T02:37:56.511Z,3.0,3.0
2022-12-27T02:38:56.511Z,4.0,4.0
2022-12-27T02:39:56.511Z,5.0,5.0
2022-12-27T02:40:56.511Z,6.0,6.0
2022-12-27T02:41:56.511Z,7.0,7.0
The 10 results had been acquired.
gs[public]> tql lctime select sum(data) where timestamp < TIMESTAMPADD(HOUR, TIMESTAMP('2022-12-28T00:00:00Z'), -1) and timestamp > TIMESTAMPADD(HOUR, TIMESTAMP('2022-12-27T00:00:00Z'), -1);
1 results. (0 ms)
gs[public]> get 10
Result
65338.0
The 1 results had been acquired.
Nooruddin Lakhani
  • 7,507
  • 2
  • 19
  • 39

0 Answers0