原始数据
相邻两行做差
select id,valuea,valuea-@temp,@temp:=valuea from t_test_a a,(SELECT @temp:=0.0) b ORDER BY id
微信扫一扫
select id,valuea,valuea-@temp,@temp:=valuea from t_test_a a,(SELECT @temp:=0.0) b ORDER BY id
相关推荐