Reputation: 515
I used Influx for recording some serial data, and show the reports of these data.
I have a requirement like this:
Get the total sum of the value in the time 07:00 AM to 09:00 AM from 2017-05-11 to 2017-05-17.
In mysql, this is very easy, since you can get this value using one query:
select sum(value) from series where time(time) >= '07:00:00' and time(time) < '09:00:00' and time > '2017-05-11' and time < '2017-05-19'
But in Influx(I'm using 1.0.2 now), I can't see any functions like this, did influx support the query like this?
Upvotes: 3
Views: 10326
Reputation: 3860
You can use this-
select sum(value) as summed_value from series where time> '2017-03-10 00:00:00' and time<'2017-05-10 00:00:00';
Also if you want to get data using hours also ,in such cases you can use
select sum(value) as summed_value from series where time> now() - 2400h and time<now() - 1200h;
Let me know,if this solves your problem.
Upvotes: 7