receive_time>(SELECT DATE_ADD(now(),INTERVAL -2 MONTH)) SELECT DATE_ADD 获取时间间隔的函数 NOW() 当前时间 INTERVAL 时间间隔 -2 如果是正数那么就是+,负数就是- MINTH 时间格式,可填YEAR,MONTH,DAY,HOUR,MINUTE,SECOND;
SELECT * FROM DataAnalysis_HrmDataHistory WHERE belongToDate>DATE_ADD('2020-02-01',INTERVAL -1 MONTH) and belongToDate<='2020-02'
DATE_ADD('2020-02-01',INTERVAL -1 MONTH) #二月一号往前推一个月