Group by 2 mysql pieces
Mysql table:
I want to take the amount of acceleCount at intervals of 2 minutes.
Query:
select time div 120000 as TwoMinutes,
sum(acceleCount) as Sum
from acceleTable
group by time div 120000
Result:
Here, the timestamp of column twoMinutes is less. I want it to have a time stamp that is within two minutes.
Any thoughts on how to modify the SQL query?
+3
source to share
2 answers