select (@csum := @csum+a.total) as total,a.time as time
from (
select count(*) as total , year(insert_time)*10000+1+100*(month(insert_time)-(month(insert_time)-1)%3) as time
from t_device_android group by year(insert_time)*10000+1+100*(month(insert_time)-(month(insert_time)-1)%3)
) a , (SELECT @csum := 0) as r ;
网友评论