利用lead()和lag()select code,value,lead(value,1,null)over(partition by code order by value) after_value from test不是你的问题我都快想不起来这个函数了。