3 ms·
I would assume that it is treated as (num1 <= date) <= num2. So (num1 < date) is true (1) or false (0) which is then (probably) less than date.
by kevincox 5y ago
I would assume that it is treated as (num1 <= date) <= num2. So (num1 < date) is true (1) or false (0) which is then (probably) less than date.
- tqi 5y agoYeah that seems to be what is happening: SELECT 20171201 <= fb.date <= 0, COUNT(1), MIN(fb.date), MAX(fb.date) FROM facebook_event_checkin fb GROUP BY 1 returns: 0 6302 20171201 20180501 1 13709 20170101 20171130 . SQLite has some completely bonkers unexpected behaviors. The above query with the "GROUP BY 1" line removed returns: 0 20011 20170101 20180501 instead of throwing an error, which is an absolutely bonkers decision.
- dunefox 5y agoPostgres seems to signal an error, which is preferable IMHO.
- dunefox 5y agoBut since 2017* is smaller than even the leftmost date it's still false, isn't it?