I have a mysql MyIsam table with a field datestamp (datetime), I am trying to return all records that have a datestamp within the last 3 hours, but group it into 10 chunks (so for this example group one would be the first 18 minutes etc…)
Any ideas? Is this possible in mysql?
I think this may work:
Devide the difference with 1/10th of the 3 hour interval (1080 sec). This gives chunks 0,1,2…9, where 0 means the first 18 minutes.