OLAP ranking function expressions
You can include OLAP ranking function expressions to calculate ordinal ranks that can be applied to each row in the partitioned result set of a query or subquery.
OLAP ranking function expressions are OLAP window expressions that you can include in the Projection list of a SELECT statement, or the ORDER BY clause of a SELECT statement.
Syntax
(explicit id orfl001)
orfl001
(explicit id orfl006)
orfl006
(explicit id orfl002)
orfl002
(explicit id orfl003)
orfl003
(explicit id orfl004)
orfl004
(explicit id orfl005)
orfl005
(explicit id orfl007)
orfl007
OLAP ranking function
{ <LAG function>[] | <LEAD function> [] | <RANK function>[] | <DENSE_RANK function>[] | <PERCENT_RANK function>[] | <CUME_DIST function>[] | <NTILE function>[] }
Usage
The ranking values that these functions return are dependent on the window ORDER clause within the OVER clause. The ORDER clause defines the columns or expressions that the database server uses to calculate the ranking values.
If you omit the window PARTITION clause, the scope of the ranking function is the entire result set of the query or subquery, rather than partitioned subsets of results.
3 See RANK function
4 See DENSE_RANK function
6 See CUME_DIST function
7 See NTILE function