I'm trying to figure out how to select from this sample table and sum first 2 records, next two records, etc…. I have been trying to use rank and ceil but i'm clearly not managing to achieve success so thanks in advance to the human out there that can help.
recid text1 int_value
1 Blue 3
2 Green 4
3 Yellow 6
4 Red 9
5 Purple 34
6 Black 3
to achieve desired result of summing 1st/2nd row, then 3rd/4th row, then 5th/6th row something like:
sumvalueis
7
15
37
In reality the table might have more rows but this is a sample with only 6 rows and adding int_value for 1st/2nd, 3rd/4th, 5th/6th, etc..