程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
 程式師世界 >> 數據庫知識 >> Oracle數據庫 >> Oracle教程 >> Oracle分析函數詳解(AnalyticFunctions)

Oracle分析函數詳解(AnalyticFunctions)

編輯:Oracle教程

一、概念介紹:

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_clause)定義的窗口(window)。窗口決定了用於計算的行范圍。窗口大小可以用多個物理行大小或者邏輯區間進行度量例如時間。

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.

分析函數式查詢中除需要再最終處理的order by子句之外最後執行的操作。所有連接和where, group by和having子句都在分析函數之前完成。因此,分析函數只能用於選擇列或order by子句中。

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

分析函數通常用於計算累積值,數據移動值,中間值和報告聚合值。

二 語法介紹:

Description of analytic_function.gif follows

 

  1. 上一頁:
  2. 下一頁:
Copyright © 程式師世界 All Rights Reserved