r/DatabaseHelp • • Apr 19 '16

Average of every N rows, with SQLite?

Lets say for table:

Col1Col2
4Bar
2Foo
6Baz
9Banana
10FooBar
5Apple

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

9 comments sorted by

View all comments

Show parent comment

1

u/MRoka5 Apr 19 '16

from glance it looks useable. as soon as I get on PC, I will try that out. thanks!

1

u/Quadman Apr 20 '16

any progress/feedback yet on this?

1

u/MRoka5 Apr 20 '16

Since I'm forced to use SQLite on ODroid, it doesn't seem to work :/

Thanks though.

Luckly PHP solution I use still makes it loadable in blink of an eye