The analytical functions fall into categories:
- ranking,
- aggregate,
- row comparison,
- statistical.
The function has this syntax:
function() OVER()
For example, SELECT RANK() OVER(ORDER BY salary) FROM employee
The part may be empty, as it is in the above example: "RANK()."
The contains an ordering, partitioning, or windowing clause.
The ordering clause in the above example is "OVER(ORDER BY salary)."
An analytical function that uses an ordering may also partition the result set based on some attribute value.
The Row-numbering and Ranking Functions
- ROW_NUMBER
- RANK
- DENSE_RANK
- PERCENT_RANK
- CUME_DIST
- NTILE