原始数据

mysql临时变量的用法_原始数据

相邻两行做差

select id,valuea,valuea-@temp,@temp:=valuea from t_test_a a,(SELECT @temp:=0.0) b ORDER BY id

mysql临时变量的用法_原始数据_02