Hi All
The other day I wrote a query for sqLite to return the standard deviation of a column.
Imagine my disappointment when I found that sqLite doesn't provide standard deviation or variance aggregate functions. All of the other mainstream relational databases do!
So what to do? I had to read in the whole data set and do the variance using Welford's method. Not much fun.
I had a look at
https://www.b4x.com/android/forum/threads/sqlite-make-custom-functions-and-regex.87073/#content
but this only seems to apply to single rows.
I did some more research and found that sqLite provides a create_aggregate function.
My question is can I use this function in b4x to provide the stats functions I require?
I am assuming there is some java out there that provides the create_aggregate functionality.
Best Regards
Rob
The other day I wrote a query for sqLite to return the standard deviation of a column.
B4X:
SELECT STD(colFred), AVG(colFred) FROM tblFredsTable ...
Imagine my disappointment when I found that sqLite doesn't provide standard deviation or variance aggregate functions. All of the other mainstream relational databases do!
So what to do? I had to read in the whole data set and do the variance using Welford's method. Not much fun.
I had a look at
https://www.b4x.com/android/forum/threads/sqlite-make-custom-functions-and-regex.87073/#content
but this only seems to apply to single rows.
I did some more research and found that sqLite provides a create_aggregate function.
My question is can I use this function in b4x to provide the stats functions I require?
I am assuming there is some java out there that provides the create_aggregate functionality.
Best Regards
Rob