我正在执行这个查询。
select (select FollowersCount from webanalysis.DataTwUser_followers_history where DataTwUserID='80943' and Date <='2015-01-12' order by Date desc limit 1) - (select FollowersCount from webanalysis.DataTwUser_followers_history where DataTwUserID='80943' and Date
我需要从出生之日起按年份范围分组。这就是我到目前为止所做的。如果运行包含500000条记录的存储过程,然后执行我编写的查询,您将看到大约需要25秒。我该如何改进它呢?id int not null auto_increment primary key,);
drop procedure if exists date_random //begin
declare i