Re: [sqlite] SELECT average timestamp to get average time of day?

2012-02-24 Thread Marc L. Allen
You're trying to calculate it for individual people? Can you count on night-time people to stay night-time, or do you need to worry about someone shifting by 12 hours? If not, your best bet is, for the night-time people, add, say 6 hours to all of their times, do your average, then subtract

Re: [sqlite] SELECT average timestamp to get average time of day?

2012-02-24 Thread C M
On Fri, Feb 24, 2012 at 4:06 PM, Marc L. Allen wrote: > Actually this is quite an interesting question. > > Given two fixed times of midnight and noon, having the third time one > minute before or after midnight drastically changes what I think you want > the

Re: [sqlite] SELECT average timestamp to get average time of day?

2012-02-24 Thread Steinar Midtskogen
[C M ] > For example, the average I'd > want from these three timestamps: > > '2012-02-18 22:00:00.00' > '2012-02-19 23:00:00.00' > '2012-02-28 01:00:00.00' > > Should be 11:20pm, as they are all within a few hours of each other at > night. I have not been able to

Re: [sqlite] SQLite shell dot commands

2012-02-24 Thread Benoit Mortgat
On Fri, Feb 24, 2012 at 16:22, Simon Slavin wrote: > It is faster, simpler, and would introduce far fewer ambiguities and > opportunities for bugs, simply to remove the ability to create tables > with whacky names.  There are no real restrictions on table names in > the SQL

Re: [sqlite] SELECT average timestamp to get average time of day?

2012-02-24 Thread Marc L. Allen
I don't think that'll do it. His example shows that, in that specific case, he wants to treat 1:00 as 25:00 for the purposes of averaging, and he also wants to ignore the actual day. Essentially, he wants to average 22:00, 23:00 and 01:00 and come up with 23:20, in this particular case. To

Re: [sqlite] SELECT average timestamp to get average time of day?

2012-02-24 Thread Richard Hipp
On Fri, Feb 24, 2012 at 3:51 PM, C M wrote: > I'd like to have a SELECT query to get the average time of a person's day > (not necessarily a strict 24 hour day) given timestamps of the form: > '-MM-DD HH:MM:SS.mm'. The data will have gaps of days in which > there is

Re: [sqlite] SELECT average timestamp to get average time of day?

2012-02-24 Thread Marc L. Allen
Sorry.. second example should be: Midnight, Noon, 11:59 PM -> Average around 10 PM > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of Marc L. Allen > Sent: Friday, February 24, 2012 4:07 PM > To: General Discussion of

Re: [sqlite] SELECT average timestamp to get average time of day?

2012-02-24 Thread Marc L. Allen
I'm not sure that's possible without more spec. What is the average time for midnight, 8 AM, and 4PM? > -Original Message- > From: sqlite-users-boun...@sqlite.org [mailto:sqlite-users- > boun...@sqlite.org] On Behalf Of C M > Sent: Friday, February 24, 2012 3:52 PM > To: General

[sqlite] SELECT average timestamp to get average time of day?

2012-02-24 Thread C M
I'd like to have a SELECT query to get the average time of a person's day (not necessarily a strict 24 hour day) given timestamps of the form: '-MM-DD HH:MM:SS.mm'. The data will have gaps of days in which there is no timestamp for that day. The problem is, simply averaging times of day

Re: [sqlite] SQLite shell dot commands

2012-02-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 24/02/12 07:22, Simon Slavin wrote: > I can't find any documentation about what SQLite considers to be an > acceptable table name. Providing you use quotation, anything is acceptable as a table name including zero length strings. create table

Re: [sqlite] SQLite3 FTS4 matchinfo() problem

2012-02-24 Thread Dan Kennedy
On 02/23/2012 10:22 PM, Felix Timm wrote: Dear Sir or Madam, I am using the FTS4 module of SQLite3 and have a problem with the Example of the matchinfo() auxiliary function. At the moment I am just trying to run the matchinfo() example from http://www.sqlite.org/fts3.html#matchinfo and it

Re: [sqlite] SQLite shell dot commands

2012-02-24 Thread Simon Slavin
On 24 Feb 2012, at 1:29pm, Benoit Mortgat wrote: > I fully agree that it's not really advisable to name a table like this. > > Still, since SQLite supports non-"\w+" table names, Is this documented somewhere ? I can't find any documentation about what SQLite considers to

Re: [sqlite] Inserts get slower and slower

2012-02-24 Thread Don V Nielsen
Follow-up on this issue. (Re-Post of previous which included large .jpg. I converted .jpg to text [see below] to make message smaller, and then deleted previous post.) This morning I used a JetBrains product called dotTrace to analyze my application's resource usage. I loaded a 7 million rows

Re: [sqlite] Possible bug when rebuilding amalgamation with-DSQLITE_ZERO_MALLOC

2012-02-24 Thread thierryn1
I thing it try to link or get some info from your installed version on sqlite3. It hapens probably when you try to compile the doc. Try to remove the installed version before you compile it. I agreed, it would be nice if this issue could be solved Correct me if I'm wrong Regards tnut

Re: [sqlite] one table versus multiple

2012-02-24 Thread Rita
thanks for the response. I assume the schema would be like this CREATE TABLE user( id INTEGER PRIMARY KEY AUTOINCREMENT, name TEXT NOT NULL); CREATE TABLE main( t long, uid integer, price real, *FOREIGN KEY(uid) REFERENCES user(id)* ); Then I would first read

Re: [sqlite] Limit on the Compound Select Statements

2012-02-24 Thread Don V Nielsen
Would it make more sense to put the values into a text file and import the text file? It separates the data from the application, and simplifies making future changes to the list. On Thu, Feb 23, 2012 at 1:52 PM, Abhinav Upadhyay < er.abhinav.upadh...@gmail.com> wrote: > On Thu, Feb 23, 2012 at

Re: [sqlite] SQLite shell dot commands

2012-02-24 Thread Benoit Mortgat
On Fri, Feb 24, 2012 at 13:28, Don V Nielsen wrote: > Please, I don't mean this to be offensive. I'm not. Thanks for the answer, I did not feel offended. > It was suggested that the syntax "[Ben's table]" is cumbersome. What > is really cumbersome, in my opinion, is the

Re: [sqlite] Possible bug when rebuilding amalgamation with -DSQLITE_ZERO_MALLOC

2012-02-24 Thread Richard Hipp
On Fri, Feb 24, 2012 at 2:00 AM, nn6eumtr wrote: > Steps to recreate: > > 1) wget -nd -nH -c -t 0 -w 1 http://www.sqlite.org/src/**tarball/SQLite-** >

[sqlite] Possible bug when rebuilding amalgamation with -DSQLITE_ZERO_MALLOC

2012-02-24 Thread nn6eumtr
Steps to recreate: 1) wget -nd -nH -c -t 0 -w 1 http://www.sqlite.org/src/tarball/SQLite-bf1dc7907cf1a5c7.tar.gz?uuid=bf1dc7907cf1a5c7e19b04fa1278b2089316c30a 2) mv -v SQLite-bf1dc7907cf1a5c7.tar.gz?uuid=bf1dc7907cf1a5c7e19b04fa1278b2089316c30a SQLite-bf1dc7907cf1a5c7.tar.gz 3) tar -xzf

Re: [sqlite] Inserts get slower and slower

2012-02-24 Thread Don V Nielsen
Follow-up on this issue. This morning I used a JetBrains product called dotTrace to analyze my application's resource usage. I loaded a 7 million rows into a table. When I simply loaded the table, it took 12 minutes. Pretty impressive. When I added 'Unique' to one of the fields definitions,

[sqlite] SQLite3 FTS4 matchinfo() problem

2012-02-24 Thread Felix Timm
Dear Sir or Madam, I am using the FTS4 module of SQLite3 and have a problem with the Example of the matchinfo() auxiliary function. At the moment I am just trying to run the matchinfo() example from http://www.sqlite.org/fts3.html#matchinfo and it does not work. I tried it on Windows 7 with

Re: [sqlite] one table versus multiple

2012-02-24 Thread Oliver Peters
Am Fr 24 Feb 2012 13:56:47 CET schrieb Rita: I was wondering if its better to have a single table or multiple tables for something I am doing. I have close to 3 millions rows in a single table and here is how it looks: t,user,price 1330087935,vberry,180.00 1330087935,mson,10.7

Re: [sqlite] SQLite shell dot commands

2012-02-24 Thread Don V Nielsen
Please, I don't mean this to be offensive. I'm not. It was suggested that the syntax "[Ben's table]" is cumbersome. What is really cumbersome, in my opinion, is the table name itself. The table name includes an white space (space) and a delimiting character (apostrophe.) The simple table name

Re: [sqlite] xFilter or xBestIndex needs to know which columns were selected

2012-02-24 Thread Steinar Midtskogen
Thanks to Dan and Roger for the information and suggestions. I have about 100 columns (and millions of rows), but usually queries will only ask for a few columns. I think I know a way to work around this for my case. Basically, I don't know the exact size required for my lookahead buffer

Re: [sqlite] xFilter or xBestIndex needs to know which columns were selected

2012-02-24 Thread Roger Binns
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 On 23/02/12 23:02, Steinar Midtskogen wrote: > I know that xColumn will only get called for these columns. As Dan said there isn't a direct way of knowing. There is a reasonably convenient workaround of having multiple virtual tables with different

Re: [sqlite] xFilter or xBestIndex needs to know which columns were selected

2012-02-24 Thread Dan Kennedy
On 02/24/2012 02:02 PM, Steinar Midtskogen wrote: Hello Is it possible to find out in xFilter or xBestIndex which columns were selected? That is, if I do "SELECT a, b, c FROM t" where t is a virtual table, I would like to know in xFilter or xBestIndex that the result will only consist of the

Re: [sqlite] SQLiteDataAdaptor Missing

2012-02-24 Thread Joe Mistachkin
Electric Eddy wrote: > > Yes. It's running on 64bit but I compiled it for 32 bit. > That would explain it the log file data. Can you check and see if the registry keys from the log file data were actually created in the 32-bit registry hive? For example: