r/DatabaseHelp • u/MRoka5 • Apr 19 '16
Average of every N rows, with SQLite?
Lets say for table:
| Col1 | Col2 |
|---|---|
| 4 | Bar |
| 2 | Foo |
| 6 | Baz |
| 9 | Banana |
| 10 | FooBar |
| 5 | Apple |
It would return
| Col1 | (This is math, not actual return) |
|---|---|
| 3 | (4+2)/2 |
| 7.5 | (6+9)/2 |
| 7.5 | (10+5)/2 |
I can do this with backend code w/o problems, but letting SQ do most if data-related work, is better idea, right?
2
Upvotes
View all comments
Show parent comment
1
u/Quadman Apr 20 '16
any progress/feedback yet on this?