huanbi.png

select (tomorrowavgprice-thisday)/thisday from 
(
select sum(numbers) thisday,classcode,days from tongbi GROUP BY classcode,days

)aa
left join 
(
select  classcode, sum(numbers) tomorrowavgprice ,DATE_ADD(days,INTERVAL 1 day ) tomorrow  from tongbi GROUP BY classcode,days
)bb on aa.days=bb.tomorrow and aa.classcode=bb.classcode

select aa.classcode,aa.days,avgprice,tomorrowavgprice from
(
select classcode,avg(numbers) avgprice,days from tongbi GROUP BY classcode,days
) aa

left join
(select classcode, DATE_ADD(days,INTERVAL 1 day ) tomorrow,avgprice tomorrowavgprice from
(
select classcode,avg(numbers) avgprice,days from tongbi GROUP BY classcode,days
) bb ) cc on aa.days=cc.tomorrow and aa.classcode=cc.classcode

纯Java计算呢?

for(List list:List){

    //根据索引来
    比如说
    比较就是list[i+1]/list[i] 
    list[updown]=list[i+1]/list[i];
     

}

//是不是也可以呢?

参考文档:https://xie.infoq.cn/article/196c702a8c8d40b953b0dbf3b

标签: none

相关阅读

  • 测试信息
  • 开发商:阿里巴巴
  • 版本号:1.0
  • 配色:(企业家)” 推选活动结果
  • 测试信息
  • 测试信息
  • 测试信息