I’m trying to group results by a certain number in sql. i.e. if I have 60 lines and I want to group by groups of ten, I will have six groups of ten lines in them, reflecting the current order of the results in the table (in each group I will have the total or average of the lines in that group). Is there a way to do this?
Share
MS SQL (sqlfiddle):
MySQL (sqlfiddle):