ITPub博客

首页 > Linux操作系统 > Linux操作系统 > oracle Analytic Functions(分析函数)学习(一)

oracle Analytic Functions(分析函数)学习(一)

原创 Linux操作系统 作者:流浪人生 时间:2009-06-12 10:04:29 0 删除 编辑
        闲来无事,正好看到了一个oracle的分析函数,发现了以前许多工作没有好好利用这些函数而导致做了许多无用功,从今天开始,有时间就学习学习了  

Analytic Functions

Analytic functions compute an aggregate value based on a group of rows. They differ from aggregate functions in that they return multiple rows for each group. The group of rows is called a window and is defined by the analytic_clause. For each row, a sliding window of rows is defined. The window determines the range of rows used to perform. the calculations for the current row. Window sizes can be based on either a physical number of rows or a logical interval such as time.

Analytic functions are the last set of operations performed in a query except for the final ORDER BY clause. All joins and all WHERE, GROUP BY, and HAVING clauses are completed before the analytic functions are processed. Therefore, analytic functions can appear only in the select list or ORDER BY clause.

Analytic functions are commonly used to compute cumulative, moving, centered, and reporting aggregates.


包含的函数有(10g)

AVG *
CORR *
COVAR_POP *
COVAR_SAMP *
COUNT *
CUME_DIST
DENSE_RANK
FIRST
FIRST_VALUE *
LAG
LAST
LAST_VALUE *
LEAD
MAX *
MIN *
NTILE
PERCENT_RANK
PERCENTILE_CONT
PERCENTILE_DISC
RANK
RATIO_TO_REPORT
REGR_ (Linear Regression) Functions *
ROW_NUMBER
STDDEV *
STDDEV_POP *
STDDEV_SAMP *
SUM *
VAR_POP *
VAR_SAMP *
VARIANCE *


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

请登录后发表评论 登录
全部评论

注册时间:2008-11-11

  • 博文量
    17
  • 访问量
    50987