Re: [sqlite] racing with date('now') (was: Select with dates)

2013-09-15 Thread Petite Abeille
On Sep 15, 2013, at 10:32 PM, "Keith Medcalf" wrote: > On the other hand, if one knows that the value of 'now' is not stable then > one can always bind a parameter with the appropriate value set from the host > language Or write it down somewhere once (i.e temp table), or evaluate it once (i

Re: [sqlite] racing with date('now') (was: Select with dates)

2013-09-15 Thread Keith Medcalf
You are correct. Even though the standard says 'statement stability', I think that is less useful than transaction stability. I personally think a reference to 'now' should be stable throughout a transaction (a static value set when 'now' first accessed in a transaction and cleared on a commi

Re: [sqlite] racing with date('now') (was: Select with dates)

2013-09-15 Thread Yuriy Kaminskiy
Keith Medcalf wrote: >> In C there are local variables, where you can save result of impure >> functions when it is important. There are no local variables in SQL >> - with even more extreme example shown in E.Pasma message nearby - >> `SELECT strftime('%f') AS q FROM t WHERE q <> q`; >> oh, by

Re: [sqlite] racing with date('now') (was: Select with dates)

2013-09-15 Thread Keith Medcalf
> In C there are local variables, where you can save result of impure > functions when it is important. There are no local variables in SQL > - with even more extreme example shown in E.Pasma message nearby - > `SELECT strftime('%f') AS q FROM t WHERE q <> q`; > oh, by the way, `SELECT CURRENT_

Re: [sqlite] Question about date & time

2013-09-15 Thread Petite Abeille
On Sep 15, 2013, at 8:31 PM, William Drago wrote: > Thanks for the reply. Seconds since the epoch does make a good timestamp. Is > that what is normally used to extract data between time periods? (Date & Time seems to be a popular topic at the moment) There is nothing prescriptive in using ep

Re: [sqlite] Question about date & time

2013-09-15 Thread William Drago
Hi Tim, Thanks for the reply. Seconds since the epoch does make a good timestamp. Is that what is normally used to extract data between time periods? Say for example, I want to know for the past month what my failure rate was between 11PM and 1AM every day. I'd figure out what 11PM and 1AM

Re: [sqlite] racing with date('now') (was: Select with dates)

2013-09-15 Thread Yuriy Kaminskiy
Stephan Beal wrote: > On Sun, Sep 15, 2013 at 1:58 PM, Yuriy Kaminskiy wrote: > >> Sure, there can be several way to interpret CURRENT_* and *('now'). >> However, >> some of them can be useful (transaction, statement), and others (step) - >> cannot >> be. And some (sub-expression, the way it "wor

[sqlite] Question about begin/commit

2013-09-15 Thread William Drago
All, In the following bit of code found in the help file SQLite.NET.chm, I see that BeginTransaction() encloses everything. I always thought that just the for-loop needed to be enclosed by begin/commit. What are the reasons for enclosing the other commands? Thanks, -Bill using (SQLiteTra

Re: [sqlite] Question about date & time

2013-09-15 Thread Tim Streater
On 15 Sep 2013 at 18:13, William Drago wrote: > All, > > Should I put date and time in separate columns if I want to > select by time? > > For example: > > SELECT * FROM testresults WHERE (status != "Pass") AND > (23:00 <= testtime) AND (testtime <= 01:00). > > I have been reading the documentat

[sqlite] Question about date & time

2013-09-15 Thread William Drago
All, Should I put date and time in separate columns if I want to select by time? For example: SELECT * FROM testresults WHERE (status != "Pass") AND (23:00 <= testtime) AND (testtime <= 01:00). I have been reading the documentation, but it just isn't clear to me how I should handle this.

Re: [sqlite] Help with a self join please

2013-09-15 Thread dochsm
... and it runs in under half the time of my version, including showing the percentage and selecting only those over 75% -- View this message in context: http://sqlite.1065341.n5.nabble.com/Help-with-a-self-join-please-tp71242p71281.html Sent from the SQLite mailing list archive at Nabble.com.

Re: [sqlite] Help with a self join please

2013-09-15 Thread dochsm
Thanks Igor, that looks neater than my solution. -- View this message in context: http://sqlite.1065341.n5.nabble.com/Help-with-a-self-join-please-tp71242p71280.html Sent from the SQLite mailing list archive at Nabble.com. ___ sqlite-users mailing lis

Re: [sqlite] racing with date('now') (was: Select with dates)

2013-09-15 Thread Simon Slavin
On 15 Sep 2013, at 12:58pm, Yuriy Kaminskiy wrote: > Wow. Are you *REALLY* arguing that > SELECT * FROM t WHERE CURRENT_TIME <> CURRENT_TIME; > that randomly (!) returning rows any less broken than > SELECT * FROM t WHERE 2*2 <> 4; > also randomly returning rows? I was, because the word 'curr

Re: [sqlite] racing with date('now') (was: Select with dates)

2013-09-15 Thread E.Pasma
Op 15 sep 2013, om 14:05 heeft Stephan Beal het volgende geschreven: On Sun, Sep 15, 2013 at 1:58 PM, Yuriy Kaminskiy wrote: Sure, there can be several way to interpret CURRENT_* and *('now'). However, some of them can be useful (transaction, statement), and others (step) - cannot be. A

Re: [sqlite] racing with date('now') (was: Select with dates)

2013-09-15 Thread Stephan Beal
On Sun, Sep 15, 2013 at 1:58 PM, Yuriy Kaminskiy wrote: > Sure, there can be several way to interpret CURRENT_* and *('now'). > However, > some of them can be useful (transaction, statement), and others (step) - > cannot > be. And some (sub-expression, the way it "works" currently) are purely > i

Re: [sqlite] racing with date('now') (was: Select with dates)

2013-09-15 Thread Yuriy Kaminskiy
Simon Slavin wrote: > On 14 Sep 2013, at 10:41pm, Yuriy Kaminskiy wrote: > >> ... and I'd call even that difference between CURRENT_* and *('now') rather >> "query optimizer artifact" rather than "documented feature one can rely >> upon". >> Anyway, one way or other, it is BROKEN. > > I would a

[sqlite] List of registered tokenizers

2013-09-15 Thread Marco Bambini
What is the correct way to get a list of all registered sqlite tokenizers? Thanks a lot. -- Marco Bambini http://www.sqlabs.com http://twitter.com/sqlabs http://instagram.com/sqlabs ___ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org

Re: [sqlite] racing with date('now') (was: Select with dates)

2013-09-15 Thread Petite Abeille
On Sep 15, 2013, at 12:53 AM, Kees Nuyt wrote: > 3) If an SQL-statement generally contains more than one reference > to one or more s, then all such ref- > erences are effectively evaluated simultaneously. FWIW, Oracle concurs: "All of the datetime functions that return current system dat