mysql - How to get data by date range given only month and year

前端 未结 5 693
轮回少年
轮回少年 2021-01-15 16:18

Below is my mysql table:

--------------------------
ID  Date_From   Date_To
--------------------------
1   2011-02-01  2011-02-28
2   2012-09-01  2012-09-30
         


        
5条回答
  •  温柔的废话
    2021-01-15 16:51

    In id 6 the from date is 2013-01-01 and it fails in 2013-01-01 as the month is 01 which is less than 10. As you have mentioned all and condition so any false will not include that record.

提交回复
热议问题