Home:ALL Converter>SQLite and fractional seconds comparison in datetime

SQLite and fractional seconds comparison in datetime

Ask Time:2016-03-08T02:02:48         Author:FunCod

Json Formatter

So, I have a following SQLite query:

SELECT datetime('2013-10-07 08:23:19.111') = datetime('2013-10-07 08:23:19.222')

To my surprise the result that I get is ... 1 (true). No matter what values I put after the dot, it is always true when fractional values are different.

According to docs:

In formats 4, 7, and 10, the fractional seconds value SS.SSS can have one or more digits following the decimal point. Exactly three digits are shown in the examples because only the first three digits are significant to the result, but the input string can have fewer or more than three digits and the date/time functions will still operate correctly.

Is there some sort of mistake or is there something I don't understand?

Author:FunCod,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/35850729/sqlite-and-fractional-seconds-comparison-in-datetime
yy