Re: [sqlite] WHERE expression problem

2006-03-14 Thread drh
Eno Thereska <[EMAIL PROTECTED]> wrote: > Hi, > > I noticed the following strange problem when the expression to WHERE > contains clauses that refer to the same column. Here are three queries > and their output: > > > select count(*) from table1 > where ((timestamp >13448180261410868) and (tim

Re: [sqlite] WHERE expression problem

2006-03-14 Thread drh
Eno Thereska <[EMAIL PROTECTED]> wrote: > the integer is a 64-bit value. Does SQLite have > trouble with those? Nope. Not that I am aware of. > > Although it appears the above is not the problem, I am curious if SQlite > will ever store an integer as a string, if the column type is > explici

Re: [sqlite] Re: - [sqlite] WHERE expression problem

2006-03-14 Thread Eno Thereska
I tried all bracket combinations before emailing. It doesn't seem to be a problem with the brackets. Thanks Eno [EMAIL PROTECTED] wrote: Try: select count(*) from table1 where (timestamp >13448180261410868 and timestamp <= 13448182164507680); not: select count(*) from table1 where ((timesta

Re: [sqlite] WHERE expression problem

2006-03-14 Thread Eno Thereska
Thanks for the quick reply. >SELECT DISTINCT typeof(timestamp) FROM table1; returned "integer". Now the integer is a 64-bit value. Does SQLite have trouble with those? Although it appears the above is not the problem, I am curious if SQlite will ever store an integer as a string, if the

Re: [sqlite] Re: - [sqlite] WHERE expression problem

2006-03-14 Thread rbundy
Try: select count(*) from table1 where (timestamp >13448180261410868 and timestamp <= 13448182164507680); not: select count(*) from table1 where ((timestamp >13448180261410868) and (timestamp <= 13448182164507680)); Regards. rayB ** PLEASE CONSIDER OUR ENVIRONMENT BEFORE PRINTING

Re: [sqlite] Re: - [sqlite] WHERE expression problem

2006-03-14 Thread Eno Thereska
Sorry, I should have said "at or before time A" :) The problem still remains (taking off the equal sign doesn't change anything). Thanks Eno [EMAIL PROTECTED] wrote: "The second query says that before time A there are 46 entries." No, that is not what the query states: select count(*) from

Re: [sqlite] WHERE expression problem

2006-03-14 Thread drh
Eno Thereska <[EMAIL PROTECTED]> wrote: > Hi, > > I noticed the following strange problem when the expression to WHERE > contains clauses that refer to the same column. Here are three queries > and their output: > > > select count(*) from table1 > where ((timestamp >13448180261410868) and (tim

[sqlite] Re: - [sqlite] WHERE expression problem

2006-03-14 Thread rbundy
"The second query says that before time A there are 46 entries." No, that is not what the query states: select count(*) from table1 where (timestamp<=13448180261410868); ^ Regards. rayB ** PLEASE CONSIDER OUR ENVIRONMENT BEFORE PRINTING * *

[sqlite] WHERE expression problem

2006-03-14 Thread Eno Thereska
Hi, I noticed the following strange problem when the expression to WHERE contains clauses that refer to the same column. Here are three queries and their output: select count(*) from table1 where ((timestamp >13448180261410868) and (timestamp <= 13448182164507680)); output: 100 select cou