I\'ve got a monitoring system that is collecting data every n seconds (n is approximately 10 but varies). I\'d like to aggregate the collected data by 15 minute intervals.
SELECT FLOOR(UNIX_TIMESTAMP(timestamp)/(15 * 60)) AS timekey FROM table GROUP BY timekey;