Suppose I have a table with 3 columns:
I have the following records:
Simple query:
SELECT * FROM time_history GROUP BY ROUND(UNIX_TIMESTAMP(time_stamp)/3);