Group data in MySQL every N hours
Using the hour to aggregate.. in this example every 3 hours.
select * from tbl_sometable group by floor(hour(time) / 3);
Using the hour to aggregate.. in this example every 3 hours.
select * from tbl_sometable group by floor(hour(time) / 3);