Using the Window Functions : Window Functions « Analytical Functions « Oracle PL/SQL Tutorial

Oracle PL/SQL Tutorial
2.Query Select
4.Insert Update Delete
7.Table Joins
10.SQL Data Types
11.Character String Functions
12.Aggregate Functions
13.Date Timestamp Functions
14.Numerical Math Functions
15.Conversion Functions
16.Analytical Functions
17.Miscellaneous Functions
18.Regular Expressions Functions
19.Statistical Functions
20.Linear Regression Functions
21.PL SQL Data Types
22.PL SQL Statements
23.PL SQL Operators
24.PL SQL Programming
27.Function Procedure Packages
29.SQL PLUS Session Environment
30.System Tables Data Dictionary
31.System Packages
32.Object Oriented
34.Large Objects
36.User Privilege
Oracle PL/SQL Tutorial » Analytical Functions » Window Functions 
16.29.1.Using the Window Functions

Window functions calculates things like

  1. cumulative sums,
  2. moving averages within a specified range of rows,
  3. a range of values, or
  4. an interval of time.

Window function can work with: SUM(), AVG(), MAX(), MIN(), COUNT(), VARIANCE(), and STDDEV().

Window function can also work with FIRST_VALUE() and LAST_VALUE(), which return the first and last values in a window.

16.29.Window Functions
16.29.1.Using the Window Functions
16.29.2.Performing a Cumulative Sum
16.29.3.Use ROWS UNBOUNDED PRECEDING to implicitly indicate the end of the window is the current row
16.29.4.Performing a Moving Average
16.29.5.Performing a Centered Average
16.29.6.Moving average
16.29.7.Row-ordering is done first and then the moving average
16.29.8.Use SUM for windowing
16.29.9.Use the COUNT aggregate analytical function to show how many rows are included in each window
16.29.10.An Expanded Example of a Physical Window
16.29.11.Displaying which rows are used in the moving average calculations with two other analytical functions: FIRST_ VALUE and LAST_VALUE.  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.