问题描述
解决方法
你似乎想要lag()
:
select t.*,(weight -
lag(weight,1,weight) over (partition by id order by date)
) as weight_diff
from t;
你的图片真的很难看,所以我只使用了描述中给出的名字。
你似乎想要lag()
:
select t.*,(weight -
lag(weight,1,weight) over (partition by id order by date)
) as weight_diff
from t;
你的图片真的很难看,所以我只使用了描述中给出的名字。