ITPub博客

首页 > 数据库 > Oracle > Rows unbounded preceding and ROWS unbounded following 说明

Rows unbounded preceding and ROWS unbounded following 说明

Oracle 作者:rudyMatrix 时间:2016-03-23 15:14:54 0 删除 编辑

https://community.oracle.com/thread/1020352?tstart=0

 


when you ORDER a set of records in analytic functions you can specify a window of rows to consider,ignoring the others.
You can do this using the ROWS clause

UNBOUNDED PRECEDING
The window starts at the first row of the partition.

UNBOUNDED FOLLOWING
The window ends at the last row of the partition.

CURRENT ROW
window begins at the current row or ends at the current row

n PRECEDING or n FOLLOWING
The window starts or ends n rows before or after the current row

Hence, in your example,

ROWS BETWEEN Unbounded preceding AND 1 Preceding

means that the window goes from the first row of the partition to the row that stands (in the ordered set) immediatly before the current row...


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/20864683/viewspace-2062562/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    10
  • 访问量
    4961