Select 来自 MYSQL 数据库的当月和下月的所有数据

Select all data from current month and next month from MYSQL database

我不知道该怎么做,我尝试了很多不同的方法,但我没有找到可行的方法,所以请帮助我:)

我当前的查询如下:

SELECT * FROM `police` 
WHERE skadenca BETWEEN DATE(now()) 
  AND adddate(current_date, interval +1 month) 
  AND produkt LIKE 'avto' 
  AND statusobnove=0 AND status=0

所以就像我已经说过的,我想获取当前月份和下个月的所有数据。

理解您的问题的方法不止一种。

Between current date and the end of next month 将短语为:

where 
    skadenca >= current_date 
    and skadenca < date_format(current_date, '%Y-%m-01') + interval 2 month

从本月开始到下个月结束将是:

where 
    skadenca >= date_format(current_date, '%Y-%m-01')
    and skadenca < date_format(current_date, '%Y-%m-01') + interval 2 month

当前日期和提前一个月之间将是:

where 
    skadenca >= current_date
    and skadenca < current_date + interval 1 month