>
>   I would love to do an sql query that would look like the following
> ones.  I wonder if they are possible and valid applications for SQL and
> what would be the proper implementation for these.  I know I can calculate
> all this using C, but it would be most useful (to my later projects) to do
> it in SQL directly (my last example gives you an idea where I'm going).
>
> select max(opening_price, closing_price, high_price) - min(opening_price,
> closing_price, low_price) as day_range...
> select closing_price, moving_average(20,closing_price),
> exp_mov_avg(20,closing_price)...
> select closing_price, moving_average( funky_oscillator( closing_price )
> )...
>


I have described the problem that I was facing.
You guys provided all the pieces of the puzzle.
I now have to solve the problem.


Here's the path that I have decided to take for now, more or less in
priority:

  - Implement what I need now in plain C++, after the data is extracted
from sqlite.
  - Understand what analytical functions are, look at their implementations
and attempt my own in plain C++
  - Experiment at creating my own sqlite functions, agg.functions and
virtual tables as these will be instrumental to my goal or future goals.
  - Look into the libraries you guys suggested for analyzing the data (I
keep this mostly last because my analytic skills are still at a minimum, so
this could be the most difficult path and I also see educational value in
re-inventing the wheel for now, but I do understand this step may be
required to move to higher levels of analysis).
  - Look at sqlite's source code and try to implement analytical functions
in a way that leads to an optimization better than log(n^2) and contribute
my findings on this topic back to the community.

Thank you all very much for all your answers, they have been most useful.

Simon
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to