一.MYSQL查询最近的三个月份的简便方法: select date_format(curdate(),'%Y-%m') from dual union MONTH),'%Y-%m') from dual union MONTH),'%Y-%m') from dual  二.sql查询两个日期内的所有日期 ,date_format(adddate('2018-03-11', INTERVAL @num DAY),'%Y-%m-%d') as date ) t where adddate('2…