4 ms·
I don't know much about databases but shouldn't where num1 <= date <= num2 throw an error if it's not supported, yet silently returns false data? The date
by dunefox 5y ago
I don't know much about databases but shouldn't
where num1 <= date <= num2
throw an error if it's not supported, yet silently returns false data? The dates are integers.
select * from facebook_event_checkin fb
where 20171201 <= fb.date <= 20171231:
28508 | 5880 | Nudists are people who wear one-button suits. | 20170913 <--
- kevincox 5y agoI 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?