Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Petite Abeille
On Mar 28, 2012, at 12:50 AM, Simon wrote: > - 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. Enhancing SQLite with analytics would be a

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Darren Duncan
Simon Slavin wrote: On 27 Mar 2012, at 11:50pm, Simon wrote: Thank you all very much for all your answers, they have been most useful. You're welcome. Something else to consider is whether you should be doing this in C. C++ can do everything, but it's not ideally

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Simon Slavin
On 27 Mar 2012, at 11:50pm, Simon wrote: > Thank you all very much for all your answers, they have been most useful. You're welcome. Something else to consider is whether you should be doing this in C. C++ can do everything, but it's not ideally suited to heavy

Re: [sqlite] Feature request: references from view to himself

2012-03-27 Thread Igor Tandetnik
On 3/27/2012 7:10 PM, Alexey Pechnikov wrote: Is it possible to permit this behaviour? CREATE TEMP TABLE user_record (id INTEGER PRIMARY KEY, user_id INTEGER, name TEXT); CREATE TEMP VIEW v_user AS SELECT id, name, (SELECT name FROM v_user WHERE id=r.user_id) as "user" FROM user_record as r;

[sqlite] Feature request: references from view to himself

2012-03-27 Thread Alexey Pechnikov
Is it possible to permit this behaviour? CREATE TEMP TABLE user_record (id INTEGER PRIMARY KEY, user_id INTEGER, name TEXT); CREATE TEMP VIEW v_user AS SELECT id, name, (SELECT name FROM v_user WHERE id=r.user_id) as "user" FROM user_record as r; Error: no such table: v_user -- Best regards,

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Simon
> > 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

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Simon
> I think it is possible to create a custom aggregate function which would > work on a cross-join of the data to analyse. The cross-join makes all the > data available to each bucket (group by Date, for example), and each bucket > is basically one row of the whole data. The aggregate function

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Simon Slavin
On 27 Mar 2012, at 9:47pm, Simon wrote: > But I don't think aggregates is the key here... Basically, the kind of > function I need is something like this: > For each row, in this column, calculate the foobar result on all (or a > group of) the values of another column. > I

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Simon
> > A DBMS is a good way to keep your raw data. But I highly doubt that a > majority of your analysis algorithms are going to be expressible in SQL > without going way beyond the intended purpose of the language. I think you are right, but the cases where it can be expressed in SQL means it can

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Simon
> Generally speaking, analytical functions (aka windowing functions [1]) > would appear to be the most useful for your endeavor. > > Sadly, SQLite doesn't provide anything like this out-of-the-box. > I wasn't aware of the term. Thanks! I'll be able to google on that now! ;) And here are

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Gabor Grothendieck
On Tue, Mar 27, 2012 at 3:02 PM, Simon wrote: > select closing_price, moving_average( funky_oscillator( closing_price ) )... There is a moving average calculation in SQLite here but given the complexity you might prefer to do the analytical portion in your program:

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Doug Currie
On Mar 27, 2012, at 3:46 PM, Larry Brasfield wrote: > A DBMS is a good way to keep your raw data. But I highly doubt that a > majority of your analysis algorithms are going to be expressible in SQL > without going way beyond the intended purpose of the language. You will > either find

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Larry Brasfield
Hi there, I'm about to start a project I have been thinking about for a long while. I basically wish to analyse stock market data. I already have the data in a table and I'm now in the process of writing my own indicators and oscillators. I hope to learn while re-inventing this wheel and

Re: [sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Petite Abeille
On Mar 27, 2012, at 9:02 PM, Simon wrote: > 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. Generally speaking, analytical functions (aka windowing

[sqlite] Using SQL or C for data analysis?

2012-03-27 Thread Simon
Hi there, I'm about to start a project I have been thinking about for a long while. I basically wish to analyse stock market data. I already have the data in a table and I'm now in the process of writing my own indicators and oscillators. I hope to learn while re-inventing this wheel and

Re: [sqlite] VACUUMing large DBs

2012-03-27 Thread Simon Slavin
On 27 Mar 2012, at 5:53pm, Pete wrote: > Interesting. Does that mean any open transaction other than the VACUUM > transaction? I'm still confused. This is my fault. I forgot VACUUM was an exception. Please ignore what I wrote and believe what Peter wrote: You must

Re: [sqlite] VACUUMing large DBs

2012-03-27 Thread Jay A. Kreibich
On Tue, Mar 27, 2012 at 09:53:38AM -0700, Pete scratched on the wall: > Interesting. Does that mean any open transaction other than the VACUUM > transaction? I'm still confused. The database connection running the VACUUM command cannot currently be in a transaction, nor can there be any

Re: [sqlite] VACUUMing large DBs

2012-03-27 Thread Pete
Interesting. Does that mean any open transaction other than the VACUUM transaction? I'm still confused. Pete On Tue, Mar 27, 2012 at 9:00 AM, wrote: > Message: 5 > Date: Mon, 26 Mar 2012 10:25:49 -0700 (PDT) > From: Peter Aronson > To:

Re: [sqlite] Query to remove duplicate values ​​in a field?

2012-03-27 Thread Simon Slavin
On 27 Mar 2012, at 5:12pm, Alessio Forconi wrote: > is there a way to update a field in this way? > > Fieldtoupdate: > 1) Location: Rome. Location: New York. > 2) Location: Florence. Location: Tuscany. Place: Arezzo > > I want to update in this manner: > 1) Location: Rome.

[sqlite] Query to remove duplicate values ​​in a field?

2012-03-27 Thread Alessio Forconi
Hello everyone, is there a way to update a field in this way? Fieldtoupdate: 1) Location: Rome. Location: New York. 2) Location: Florence. Location: Tuscany. Place: Arezzo I want to update in this manner: 1) Location: Rome. Lazio. 2) Location: Florence. Tuscany. Arezzo It can be done with a

Re: [sqlite] memory handling problems in 3.710 - 3.7.11

2012-03-27 Thread Black, Michael (IS)
Don't see any problems here with valgrind. Red Hat Enterprise Linux Server release 5.7 (Tikanga) [sqlite-amalgamation-3071100]$ gcc -g -o shell shell.c sqlite3.c -ldl -lpthread [sqlite-amalgamation-3071100]$ ./shell SQLite version 3.7.11 2012-03-20 11:35:50 Enter ".help" for instructions

Re: [sqlite] HOW TO EXPORT TABLE HEAD

2012-03-27 Thread Gabor Grothendieck
On Mon, Mar 26, 2012 at 11:38 PM, YAN HONG YE wrote: > WHEN I export sqlite database to a html file or txt file, I couldn't know how > to include the database table head. > who can tell me? > Thank you! Use -header like this: sqlite3 -html -header my.db "select * from

Re: [sqlite] NaN in, 0.0 out?

2012-03-27 Thread Simon Slavin
On 27 Mar 2012, at 3:42am, "Jay A. Kreibich" wrote: > On Tue, Mar 27, 2012 at 03:30:03AM +0100, Simon Slavin scratched on the wall: >> >> On 27 Mar 2012, at 3:12am, Jay A. Kreibich wrote: >> >>> On Sun, Mar 25, 2012 at 05:48:01AM +0100, Simon Slavin scratched

Re: [sqlite] memory handling problems in 3.710 - 3.7.11

2012-03-27 Thread Laszlo Boszormenyi
Dear Richard, On Mon, 2012-03-26 at 08:20 -0400, Richard Hipp wrote: > On Sun, Mar 25, 2012 at 9:32 PM, Laszlo Boszormenyi > wrote: > On Debian and amd64 architecture SQLite3 has a severe problem. > If I just > start it, I can create a simple table like

[sqlite] Parser bug on sub joins when on right side of the join operator

2012-03-27 Thread Mathieu TAUZIN
Hi, According to their definition (http://sqlite.org/syntaxdiagrams.html#single-source) , Join sources (named single-source) are either : * a table or view with an optional alias and/or with an optional index * a sub query with an optional alias

Re: [sqlite] .headers error

2012-03-27 Thread Simon Davies
On 27 March 2012 06:03, YAN HONG YE wrote: > C:\sqlite\lib>sqlite3 -html foods.db "select * from dzh;" >mm.html "-headers > on" > > sqlite3: Error: too many options: "-headers on" > Use -help for a list of options. > how to write this command? sqlite3 -html -header foods.db

Re: [sqlite] how to export to html file with table

2012-03-27 Thread ajm
Hi: Perhaps some of you would be interested AscToTab, a free utility that is over there from a long time. http://www.jafsoft.com/asctotab/ HTH. Adolfo J. Milllán. Z.S. > > Mensaje original > De: Simon Slavin > Para: General Discussion of SQLite Database

Re: [sqlite] NaN in, 0.0 out?

2012-03-27 Thread Dominique Pellé
Francis J. Monari, Esquire wrote: > All, > > How are +infinity and -infinity handled? > > Frank. Don't forget signed zero, signaling and quiet NaN. Here is a short c++ programs to show how +infinity, -infinity zero, -zero, quiet NaN, signaling NaN are internally