[sqlite] sqlite bug? -- inconsistent time searches

2011-04-02 Thread Ian Strascina
I have come across inconsistent results of queries using datetime functions and values. I have based everything I tested off of this page: http://www.sqlite.org/lang_datefunc.html I have a table with a /start_date/ property. The values written are UTC time of the format

Re: [sqlite] sqlite bug? -- inconsistent time searches

2011-04-02 Thread Simon Slavin
On 1 Apr 2011, at 11:31pm, Ian Strascina wrote: > I have come across inconsistent results of queries using datetime functions > and > values. I have based everything I tested off of this page: > http://www.sqlite.org/lang_datefunc.html There's a problem with that web page. The ISO standard

Re: [sqlite] sqlite bug? -- inconsistent time searches

2011-04-02 Thread Simon Slavin
On 2 Apr 2011, at 4:30pm, Simon Slavin wrote: > The ISO standard separates date and time with exactly 'T' or 't'. Wrong. Sorry about that. The ISO standard specifies a capital 'T'. Other standards which are obviously based on it suggest that a lower-case 't' is acceptable. Apologies for

Re: [sqlite] sqlite bug? -- inconsistent time searches

2011-04-02 Thread Jean-Christophe Deschamps
>It's a pain in the arse that one has to pay for copies of the >ISOs. What do they think we're paying them for ? I also find this a perverse effect totally contrary to their mission or at least its spirit: produce good standards for public use. Without free access to reference up-to-date

Re: [sqlite] sqlite bug? -- inconsistent time searches

2011-04-02 Thread Igor Tandetnik
Ian Strascina wrote: > So is this a sqlite bug in that inconsistent results are coming from queries > that should be functionally equivalent according to the above documentation Realize that SQLite doesn't have a date or datetime data types. All the calculations are

Re: [sqlite] updating records in table A from joined recordsintableB

2011-04-02 Thread Igor Tandetnik
Robert Poor wrote: > On Fri, Apr 1, 2011 at 21:36, Igor Tandetnik wrote: >> update table_a set avalue = ( >> select bvalue from table_b where akey=bkey >> union all >> select avalue); > > That also works. But at the risk of "moving the finish line during

Re: [sqlite] updating records in table A from joined recordsintableB

2011-04-02 Thread Robert Poor
On Sat, Apr 2, 2011 at 11:10, Igor Tandetnik wrote: > If possible, set up your table so that INSERT OR REPLACE works for it. E.g. > declare "key" field unique, or primary key. Yah, I've used INSERT OR REPLACE -- it's a nice extension that works like a champ. I'm writing a

[sqlite] Is this normal?

2011-04-02 Thread Matt Young
sqlite> select 1 as type union select 2; type 1 2 sqlite> select 'tr' as type union select 2; type 2 tr sqlite> The order of the rows change when text replaces a numeric. ___ sqlite-users mailing list sqlite-users@sqlite.org

Re: [sqlite] Is this normal?

2011-04-02 Thread Eric Smith
On Sat, Apr 2, 2011 at 8:01 PM, Matt Young wrote: > sqlite> select 1 as type union select 2; > type > 1 > 2 > sqlite> select 'tr' as type union select 2; > type > 2 > tr > sqlite> > > The order of the rows change when text replaces a numeric. > My understanding is that if

Re: [sqlite] Is this normal?

2011-04-02 Thread Jay A. Kreibich
On Sat, Apr 02, 2011 at 05:01:34PM -0700, Matt Young scratched on the wall: > sqlite> select 1 as type union select 2; > type > 1 > 2 > sqlite> select 'tr' as type union select 2; > type > 2 > tr > sqlite> Yes. First, understand that the row order of all SQL queries is undefined, unless

Re: [sqlite] Is this normal?

2011-04-02 Thread Matt Young
Right, ORDER by, oherwise the row order is undefined. Why the urge to grab the mailing list, then look at the references? Dunno, sloppy hobbyist.. On Sat, Apr 2, 2011 at 5:14 PM, Jay A. Kreibich wrote: > On Sat, Apr 02, 2011 at 05:01:34PM -0700, Matt Young scratched on the