mysql between operator with dates

前端 未结 4 1117
栀梦
栀梦 2021-01-15 16:46
select \'2011-02-29\' BETWEEN \'2011-02-01\' AND \'2011-03-03\'‎

this is returning 1. I think between doesn\'t consider leap year.

4条回答
  •  再見小時候
    2021-01-15 17:21

    Problem is you're comparing strings, not dates. If you try:

    select DATE('2011-02-29') you get a NULL...
    

提交回复
热议问题