In the previous lesson we saw how filtering could be a bit confusing sometimes due to type-casting:
SELECT * FROM users WHERE created_at BETWEEN '2018-01-01' AND '2018-01-07' ORDER BY created_at DESC
This query won’t include signups from ‘2018-01-07’. ‘2018-01-07’ first will be converted to datetime type for comparison with created_at column: ‘2018-01-07 00:00:00’. This value points to the beginning of the day, so even the inclusive BETWEEN
operator doesn’t help.
Reminder: inclusive means that it acts as greater/less than or equal comparison...