MySQL Coalesce date missing results, why?
Because it converts the datetimes to strings and does the comparisons with the string values. And '2019-12-19 00:00:00' &lt;= '2019-12-19' is false in text comparison.