I have a select statement that gives a set of rows whose count is always a multiple of 8.
What I want to do is to find the sum of the first 8 rows, the second 8 rows and so on. Is there a way to do this
select a from test;
select r/8, SUM(a) from (select ROW_NUMBER() over (order by a)-1 as r,a from test) tab group by r/8;