1. 程式人生 > >rows between unbounded preceding and current row等,unbounded ,preceding ,following,current row含義詳解

rows between unbounded preceding and current row等,unbounded ,preceding ,following,current row含義詳解

unbounded:無界限
preceding:從分割槽第一行頭開始,則為 unbounded。 N為:相對當前行向前的偏移量
following :與preceding相反,到該分割槽結束,則為 unbounded。N為:相對當前行向後的偏移量
current row:顧名思義,當前行,偏移量為0

例子:

partition by  order by asc/desc rows between unbounded preceding and current row
partition by order by asc/desc rows between 1 preceding and 1 following