I have a database with many rows and I would like to consecutively aggregate say 10 rows and calculate the average of one column. So row 1 to 10 will be average value no. one, row 11 to 20 will be average value no. two, etc.
Can this be done in MySql?
You’ll need to
GROUP BY FLOOR(something/10)to group each 10 rows. A primary autoincrement key without gaps would be best for this.