Ian Strascina <istra...@gmail.com> 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 performed on strings, all comparisons are regular string 
lexicographical comparisons. If you are consistently using certain string 
formats for representing dates and times, string comparisons just happen to 
order dates correctly.

Thus, 'X Y' < 'XTY' for any substrings X and Y, whether they happen to 
represent date and time or otherwise.

For consistent results, you could either change the format of your data to 
match that produced by datetime (that is, 'YYYYMMDD HH:MM:SS') or use 
strftime('%Y-%m-%dT%H:%M:%S-00:00') in place of datetime().
-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to