4. Understanding the Elements of SQL Statements : SQL Functions : Window Functions : Window Function Syntax
 
Share this page                  
Window Function Syntax
A window function has the following format:
window_function OVER window_specification
where:
window_function
Specifies an analytical function or an aggregate function.
A select list can have more than one function, each with a different OVER clause.
OVER window_specification
Specifies a partitioning definition (optional) and an ordering definition:
([PARTITION BY partitioning_list ] ORDER BY sort_specification_list )
PARTITION BY partitioning_list
Specifies a list of column names or expressions.
ORDER BY sort_specification_list
Specifies a list of column names or expressions optionally qualified by the ASC or DESC sort directions.
Note:  ORDER BY for an aggregate function is not supported.
An empty window specification, that is, OVER(), causes the function results to be computed across all rows in the table.