I have a little odd problem with a mysql query :)
This is my table:
mysql> describe meteo;
| Field | Type | Null | Key | Default | Extra |
| id | int(11) | NO | PRI | NULL | auto_increment |
| name | varchar(32) | NO | | NULL | |
| date | datetime | NO | | NULL | |
| value | int(8) | NO | | NULL | |
My goal is this: create a query that sum all value from 14:00 to 16:00 stepping by 5 or 10 minutes.
I do something that is near the solution doing this N time from (14:00 to 16:00)
SELECT sum(value) FROM meteo WHERE date>='2016-09-9 14:30:00' AND date<='2016-09-9 14:35:00'
SELECT sum(value) FROM meteo WHERE date>='2016-09-9 14:35:00' AND date<='2016-09-9 14:40:00'
... and so on...
Exists a query that do this only giving the interval range? I whould like to have something like this in the output:
2016-09-9 14:30:00 2016-09-9 14:35:00 176
2016-09-9 14:35:00 2016-09-9 14:40:00 2312
...
Thanks for help!