今天前3个月:
select * from table where timestamp >= now()-interval 3 month;
从第一个月开始:
select * from table where timestamp >= last_day(now()) + interval 1 day - interval 3 month;

今天前3个月:
select * from table where timestamp >= now()-interval 3 month;
从第一个月开始:
select * from table where timestamp >= last_day(now()) + interval 1 day - interval 3 month;