Oracle Analytic Functions

Oracle analytic functions calculate an aggregate value based on a group of rows and return multiple rows for each group.

NameDescription
CUME_DISTCalculate the cumulative distribution of a value in a set of values
DENSE_RANKCalculate the rank of a row in an ordered set of rows with no gaps in rank values.
FIRST_VALUEGet the value of the first row in a specified window frame.
LAGProvide access to a row at a given physical offset that comes before the current row without using a self-join.
LAST_VALUEGet the value of the last row in a specified window frame.
LEADProvide access to a row at a given physical offset that follows the current row without using a self-join.
NTH_VALUEGet the Nth value in a set of values.
NTILEDivide an ordered set of rows into a number of buckets and assign an appropriate bucket number to each row.
PERCENT_RANKCalculate the percent rank of a value in a set of values.
RANKCalculate the rank of a value in a set of values
ROW_NUMBERAssign a unique sequential integer starting from 1 to each row in a partition or in the whole result
Was this tutorial helpful?