SlideShare a Scribd company logo
1 of 29
Analytical Functions
For DWH
Emrah METE
i2i-Systems
Expert Analyst&Developer
TROUG – BI/DW SIG Day 2014
03.04.2014
İTÜ
http://emrahmete.wordpress.com/about/
Marmara Üniversitesi - Bilgisayar Teknolojisi ve
Programlama
Yıldız Teknik Üniversitesi - Bilgisayar Mühendisliği
i2i-Systems – Analyst&Developer
emrahmete.wordpress.com
TROUG - Yönetim Kurulu Üyeliği
Emrah METE
Yahoo OracleTurk Grubu Moderatör
Oracle Certified Expert
Agenda
• Analytical Functions..Why?
• Aggregate and Analytic
• First/Last Value
• LAG/LEAD
• Pivoting Operations
• Ranking
• Oracle Pattern Matching
• Questions and Answers
Analytical Functions.. Why?
Aggregate and Analytic
Aggregation (Step 1 - Traditional)
SQL> select department_id,
sum(salary)
from employees
group by department_id;
Aggregation (Step 2 - Analytic)
SQL> select first_name, salary,
sum(salary) over
(order by first_name) as empsal
from employees;
Aggregation (Step 2 - Analytic)
SQL> select first_name, department_id,
sum(salary) over
(partition by department_id order by salary) as deptsal
from employees
order by department_id;
Aggregation (Step 3 - Windowing)
SQL> select employee_id, first_name, salary,
sum(salary) over ( order by employee_id rows
between unbounded preceding and current row) as
cumul
from employees
order by employee_id;
Aggregation (Step 3 - Windowing)
SQL> select employee_id, first_name, salary,
sum(salary) over ( order by employee_id rows
between 1preceding and 1 following) as cumul
from employees
order by employee_id;
Aggregation (Step 3 - Windowing)
First_Value
SQL> select first_name, department_id,
first_value(salary) over
(partition by department_id order by employee_id) as
deptsal
from employees
order by department_id;
Last_Value
SQL> select first_name, department_id, salary,
last_value(salary) over
(partition by department_id order by department_id) as
deptsal
from employees
order by department_id;
LAG & LEAD
SQL> select employee_id, first_name, salary,
LAG (salary, 1) OVER (ORDER BY salary )
AS LAG1
FROM employees;
LAG & LEAD
SQL> select employee_id, first_name, salary,
LEAD (salary, 1) OVER (ORDER BY salary ) AS
LAG1
FROM employees;
LISTAGG
SQL> select department_id, listagg(first_name,’,
’) within group (order by department_id)
as newList
FROM employees
group by department_id;
PIVOT & UNPIVOT
PIVOT & UNPIVOT
Ranking – (Rank)
SQL> SELECT department_id, last_name, salary,
RANK() OVER (PARTITION BY department_id
ORDER BY salary DESC) "Rank"
FROM employees
WHERE department_id = 60
ORDER BY department_id, "Rank", salary;
Ranking – (Dense Rank)
SQL> SELECT department_id, last_name, salary,
RANK () OVER (PARTITION BY department_id
ORDER BY salary DESC) "Rank",
DENSE_RANK () OVER (PARTITION BY
department_id ORDER BY salary DESC) "Drank"
FROM employees
WHERE department_id = 60 ORDER BY "Rank";
Ranking – (Percent Rank)
SQL> SELECT department_id, last_name, salary,
PERCENT_RANK () OVER (PARTITION BY
department_id ORDER BY salary) AS pr
FROM employees
WHERE department_id = 60
ORDER BY department_id, pr;
(rank of row in its partition - 1) / (number of rows in the partition - 1)
Example:
Last_Name: Ernst
(4 - 1) / (5 - 1) = 0,75
- Financial applications seeking
patterns of pricing, trading
volume, and other behavior
- Security applications where
unusual behavior must be
detected.
- Fraud Detection
- Sensor Data analysis.(CEP
App.)
Pattern Matching
Pattern Matching
Pattern:
Start
Bottom
End
Pattern Matching
Pattern Matching
Pattern:
Start End
References
http://connormcdonald.wordpress.com/
http://allthingsoracle.com/experts/alex-nuijten/
Dan Stober [ORACLE ANALYTIC FUNCTIONS WINDOWING CLAUSE]
http://docs.oracle.com/cd/E16655_01/server.121/e17749/toc.htm
http://www.oracle.com/technetwork/database/bi-datawarehousing/sql-analytics-index-
1984365.html
http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions056.htm
http://docs.oracle.com/cd/E16655_01/server.121/e17749/analysis.htm#DWHSG0202
http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions101.htm
http://www.oracle.com/technetwork/database/bi-datawarehousing/sql-analytics-index-
1984365.html
Questions/Answers

More Related Content

What's hot

Michael Bayer Introduction to SQLAlchemy @ Postgres Open
Michael Bayer Introduction to SQLAlchemy @ Postgres OpenMichael Bayer Introduction to SQLAlchemy @ Postgres Open
Michael Bayer Introduction to SQLAlchemy @ Postgres Open
PostgresOpen
 

What's hot (20)

Les01
Les01Les01
Les01
 
07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development07 Using Oracle-Supported Package in Application Development
07 Using Oracle-Supported Package in Application Development
 
Android de la A a la Z XML Ulises Gonzalez
Android de la A a la Z  XML Ulises GonzalezAndroid de la A a la Z  XML Ulises Gonzalez
Android de la A a la Z XML Ulises Gonzalez
 
Lesson01 学会使用基本的SQL语句
Lesson01 学会使用基本的SQL语句Lesson01 学会使用基本的SQL语句
Lesson01 学会使用基本的SQL语句
 
06 Using More Package Concepts
06 Using More Package Concepts06 Using More Package Concepts
06 Using More Package Concepts
 
Michael Bayer Introduction to SQLAlchemy @ Postgres Open
Michael Bayer Introduction to SQLAlchemy @ Postgres OpenMichael Bayer Introduction to SQLAlchemy @ Postgres Open
Michael Bayer Introduction to SQLAlchemy @ Postgres Open
 
1 - Introduction to PL/SQL
1 - Introduction to PL/SQL1 - Introduction to PL/SQL
1 - Introduction to PL/SQL
 
05 Creating Stored Procedures
05 Creating Stored Procedures05 Creating Stored Procedures
05 Creating Stored Procedures
 
PL/SQL CURSORES
PL/SQL CURSORESPL/SQL CURSORES
PL/SQL CURSORES
 
plsql les06
 plsql les06 plsql les06
plsql les06
 
ORACLE PL SQL
ORACLE PL SQLORACLE PL SQL
ORACLE PL SQL
 
09 Managing Dependencies
09 Managing Dependencies09 Managing Dependencies
09 Managing Dependencies
 
Satyapriya rajguru: Every day, in one way or another.
Satyapriya  rajguru:  Every day, in one way or another.Satyapriya  rajguru:  Every day, in one way or another.
Satyapriya rajguru: Every day, in one way or another.
 
High Performance Plsql
High Performance PlsqlHigh Performance Plsql
High Performance Plsql
 
3 sql overview
3 sql overview3 sql overview
3 sql overview
 
Stored procedures
Stored proceduresStored procedures
Stored procedures
 
Database Objects
Database ObjectsDatabase Objects
Database Objects
 
New Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL LanguageNew Stuff in the Oracle PL/SQL Language
New Stuff in the Oracle PL/SQL Language
 
ORDS - Oracle REST Data Services
ORDS - Oracle REST Data ServicesORDS - Oracle REST Data Services
ORDS - Oracle REST Data Services
 
Oracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse SupportOracle SQL Tuning for Day-to-Day Data Warehouse Support
Oracle SQL Tuning for Day-to-Day Data Warehouse Support
 

Similar to Analytical Functions for DWH

SQA server performance tuning
SQA server performance tuningSQA server performance tuning
SQA server performance tuning
Duy Tan Geek
 
SQL Server 2000 Research Series - Transact SQL
SQL Server 2000 Research Series - Transact SQLSQL Server 2000 Research Series - Transact SQL
SQL Server 2000 Research Series - Transact SQL
Jerry Yang
 
Developers' New features of Sql server express 2012
Developers' New features of Sql server express 2012Developers' New features of Sql server express 2012
Developers' New features of Sql server express 2012
Ziaur Rahman
 

Similar to Analytical Functions for DWH (20)

Db presn(1)
Db presn(1)Db presn(1)
Db presn(1)
 
Oracle Advanced SQL
Oracle Advanced SQLOracle Advanced SQL
Oracle Advanced SQL
 
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
Tony jambu   (obscure) tools of the trade for tuning oracle sq lsTony jambu   (obscure) tools of the trade for tuning oracle sq ls
Tony jambu (obscure) tools of the trade for tuning oracle sq ls
 
Nose Dive into Apache Spark ML
Nose Dive into Apache Spark MLNose Dive into Apache Spark ML
Nose Dive into Apache Spark ML
 
SQL Macros - Game Changing Feature for SQL Developers?
SQL Macros - Game Changing Feature for SQL Developers?SQL Macros - Game Changing Feature for SQL Developers?
SQL Macros - Game Changing Feature for SQL Developers?
 
SQA server performance tuning
SQA server performance tuningSQA server performance tuning
SQA server performance tuning
 
Stored procedure with cursor
Stored procedure with cursorStored procedure with cursor
Stored procedure with cursor
 
Exploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic FunctionsExploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic Functions
 
Exploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic FunctionsExploring Advanced SQL Techniques Using Analytic Functions
Exploring Advanced SQL Techniques Using Analytic Functions
 
Performance Instrumentation for PL/SQL: When, Why, How
Performance Instrumentation for PL/SQL: When, Why, HowPerformance Instrumentation for PL/SQL: When, Why, How
Performance Instrumentation for PL/SQL: When, Why, How
 
SQL Server 2000 Research Series - Transact SQL
SQL Server 2000 Research Series - Transact SQLSQL Server 2000 Research Series - Transact SQL
SQL Server 2000 Research Series - Transact SQL
 
SQL Tunning
SQL TunningSQL Tunning
SQL Tunning
 
Chapter15
Chapter15Chapter15
Chapter15
 
Developers' New features of Sql server express 2012
Developers' New features of Sql server express 2012Developers' New features of Sql server express 2012
Developers' New features of Sql server express 2012
 
Window functions with SQL Server 2016
Window functions with SQL Server 2016Window functions with SQL Server 2016
Window functions with SQL Server 2016
 
From Academic Papers To Production : A Learning To Rank Story
From Academic Papers To Production : A Learning To Rank StoryFrom Academic Papers To Production : A Learning To Rank Story
From Academic Papers To Production : A Learning To Rank Story
 
Sql storeprocedure
Sql storeprocedureSql storeprocedure
Sql storeprocedure
 
Sql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices ISql and PL/SQL Best Practices I
Sql and PL/SQL Best Practices I
 
Consultas con agrupaci¾n de datos
Consultas con agrupaci¾n de datosConsultas con agrupaci¾n de datos
Consultas con agrupaci¾n de datos
 
resource governor
resource governorresource governor
resource governor
 

Recently uploaded

Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
chadhar227
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
ahmedjiabur940
 
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
gajnagarg
 
Diamond Harbour \ Russian Call Girls Kolkata | Book 8005736733 Extreme Naught...
Diamond Harbour \ Russian Call Girls Kolkata | Book 8005736733 Extreme Naught...Diamond Harbour \ Russian Call Girls Kolkata | Book 8005736733 Extreme Naught...
Diamond Harbour \ Russian Call Girls Kolkata | Book 8005736733 Extreme Naught...
HyderabadDolls
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
gajnagarg
 
Top profile Call Girls In Rohtak [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Rohtak [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Rohtak [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Rohtak [ 7014168258 ] Call Me For Genuine Models We...
nirzagarg
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Klinik kandungan
 

Recently uploaded (20)

Gartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptxGartner's Data Analytics Maturity Model.pptx
Gartner's Data Analytics Maturity Model.pptx
 
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi ArabiaIn Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
In Riyadh ((+919101817206)) Cytotec kit @ Abortion Pills Saudi Arabia
 
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime GiridihGiridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
Giridih Escorts Service Girl ^ 9332606886, WhatsApp Anytime Giridih
 
Introduction to Statistics Presentation.pptx
Introduction to Statistics Presentation.pptxIntroduction to Statistics Presentation.pptx
Introduction to Statistics Presentation.pptx
 
Vastral Call Girls Book Now 7737669865 Top Class Escort Service Available
Vastral Call Girls Book Now 7737669865 Top Class Escort Service AvailableVastral Call Girls Book Now 7737669865 Top Class Escort Service Available
Vastral Call Girls Book Now 7737669865 Top Class Escort Service Available
 
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
Top profile Call Girls In Nandurbar [ 7014168258 ] Call Me For Genuine Models...
 
Diamond Harbour \ Russian Call Girls Kolkata | Book 8005736733 Extreme Naught...
Diamond Harbour \ Russian Call Girls Kolkata | Book 8005736733 Extreme Naught...Diamond Harbour \ Russian Call Girls Kolkata | Book 8005736733 Extreme Naught...
Diamond Harbour \ Russian Call Girls Kolkata | Book 8005736733 Extreme Naught...
 
20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf20240412-SmartCityIndex-2024-Full-Report.pdf
20240412-SmartCityIndex-2024-Full-Report.pdf
 
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
Top profile Call Girls In Chandrapur [ 7014168258 ] Call Me For Genuine Model...
 
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
5CL-ADBA,5cladba, Chinese supplier, safety is guaranteed
 
Top profile Call Girls In Rohtak [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Rohtak [ 7014168258 ] Call Me For Genuine Models We...Top profile Call Girls In Rohtak [ 7014168258 ] Call Me For Genuine Models We...
Top profile Call Girls In Rohtak [ 7014168258 ] Call Me For Genuine Models We...
 
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With OrangePredicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
Predicting HDB Resale Prices - Conducting Linear Regression Analysis With Orange
 
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptxRESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
RESEARCH-FINAL-DEFENSE-PPT-TEMPLATE.pptx
 
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
Jual obat aborsi Bandung ( 085657271886 ) Cytote pil telat bulan penggugur ka...
 
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24  Building Real-Time Pipelines With FLaNKDATA SUMMIT 24  Building Real-Time Pipelines With FLaNK
DATA SUMMIT 24 Building Real-Time Pipelines With FLaNK
 
Aspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - AlmoraAspirational Block Program Block Syaldey District - Almora
Aspirational Block Program Block Syaldey District - Almora
 
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
Gomti Nagar & best call girls in Lucknow | 9548273370 Independent Escorts & D...
 
💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...
💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...
💞 Safe And Secure Call Girls Agra Call Girls Service Just Call 🍑👄6378878445 🍑...
 
Digital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham WareDigital Transformation Playbook by Graham Ware
Digital Transformation Playbook by Graham Ware
 
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book nowVadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
Vadodara 💋 Call Girl 7737669865 Call Girls in Vadodara Escort service book now
 

Analytical Functions for DWH

  • 1. Analytical Functions For DWH Emrah METE i2i-Systems Expert Analyst&Developer TROUG – BI/DW SIG Day 2014 03.04.2014 İTÜ
  • 2. http://emrahmete.wordpress.com/about/ Marmara Üniversitesi - Bilgisayar Teknolojisi ve Programlama Yıldız Teknik Üniversitesi - Bilgisayar Mühendisliği i2i-Systems – Analyst&Developer emrahmete.wordpress.com TROUG - Yönetim Kurulu Üyeliği Emrah METE Yahoo OracleTurk Grubu Moderatör Oracle Certified Expert
  • 3. Agenda • Analytical Functions..Why? • Aggregate and Analytic • First/Last Value • LAG/LEAD • Pivoting Operations • Ranking • Oracle Pattern Matching • Questions and Answers
  • 4.
  • 5.
  • 8. Aggregation (Step 1 - Traditional) SQL> select department_id, sum(salary) from employees group by department_id;
  • 9. Aggregation (Step 2 - Analytic) SQL> select first_name, salary, sum(salary) over (order by first_name) as empsal from employees;
  • 10. Aggregation (Step 2 - Analytic) SQL> select first_name, department_id, sum(salary) over (partition by department_id order by salary) as deptsal from employees order by department_id;
  • 11. Aggregation (Step 3 - Windowing) SQL> select employee_id, first_name, salary, sum(salary) over ( order by employee_id rows between unbounded preceding and current row) as cumul from employees order by employee_id;
  • 12. Aggregation (Step 3 - Windowing) SQL> select employee_id, first_name, salary, sum(salary) over ( order by employee_id rows between 1preceding and 1 following) as cumul from employees order by employee_id;
  • 13. Aggregation (Step 3 - Windowing)
  • 14. First_Value SQL> select first_name, department_id, first_value(salary) over (partition by department_id order by employee_id) as deptsal from employees order by department_id;
  • 15. Last_Value SQL> select first_name, department_id, salary, last_value(salary) over (partition by department_id order by department_id) as deptsal from employees order by department_id;
  • 16. LAG & LEAD SQL> select employee_id, first_name, salary, LAG (salary, 1) OVER (ORDER BY salary ) AS LAG1 FROM employees;
  • 17. LAG & LEAD SQL> select employee_id, first_name, salary, LEAD (salary, 1) OVER (ORDER BY salary ) AS LAG1 FROM employees;
  • 18. LISTAGG SQL> select department_id, listagg(first_name,’, ’) within group (order by department_id) as newList FROM employees group by department_id;
  • 21. Ranking – (Rank) SQL> SELECT department_id, last_name, salary, RANK() OVER (PARTITION BY department_id ORDER BY salary DESC) "Rank" FROM employees WHERE department_id = 60 ORDER BY department_id, "Rank", salary;
  • 22. Ranking – (Dense Rank) SQL> SELECT department_id, last_name, salary, RANK () OVER (PARTITION BY department_id ORDER BY salary DESC) "Rank", DENSE_RANK () OVER (PARTITION BY department_id ORDER BY salary DESC) "Drank" FROM employees WHERE department_id = 60 ORDER BY "Rank";
  • 23. Ranking – (Percent Rank) SQL> SELECT department_id, last_name, salary, PERCENT_RANK () OVER (PARTITION BY department_id ORDER BY salary) AS pr FROM employees WHERE department_id = 60 ORDER BY department_id, pr; (rank of row in its partition - 1) / (number of rows in the partition - 1) Example: Last_Name: Ernst (4 - 1) / (5 - 1) = 0,75
  • 24. - Financial applications seeking patterns of pricing, trading volume, and other behavior - Security applications where unusual behavior must be detected. - Fraud Detection - Sensor Data analysis.(CEP App.) Pattern Matching
  • 28. References http://connormcdonald.wordpress.com/ http://allthingsoracle.com/experts/alex-nuijten/ Dan Stober [ORACLE ANALYTIC FUNCTIONS WINDOWING CLAUSE] http://docs.oracle.com/cd/E16655_01/server.121/e17749/toc.htm http://www.oracle.com/technetwork/database/bi-datawarehousing/sql-analytics-index- 1984365.html http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions056.htm http://docs.oracle.com/cd/E16655_01/server.121/e17749/analysis.htm#DWHSG0202 http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions101.htm http://www.oracle.com/technetwork/database/bi-datawarehousing/sql-analytics-index- 1984365.html