近三个月的sql:
select DATE_FORMAT(时间字段,'%Y-%m') as month from user_statistics where DATE_FORMAT(时间字段,'%Y')=YEAR(now())
group by month order by month desc limit 3
前三个月的sql:
SELECT DATE_FORMAT(create_time,'%Y-%m') as month, sum(money) FROM return_statistics where create_time>DATE_SUB(CURDATE(), INTERVAL 3 MONTH) group by MONTH