This section provides you with the most commonly used Db2 window functions.
Name | Description |
---|---|
CUME_DIST | Return the cumulative distribution of a row in a set of rows |
DENSE_RANK | Return the rank of a row in an ordered set of rows with no gaps in rank values. |
FIRST_VALUE | Access the value from the first row in a specified window frame. |
LAG | Access to a row at a given physical offset that comes before the current row without using a self-join. |
LAST_VALUE | Get the value of the last row in a specified window frame. |
LEAD | Access to the row at a given physical offset that follows the current row. |
NTH_VALUE | Access to the value of the Nth row in a set of rows. |
NTILE | Distribute an ordered set of rows to a number of buckets and assign a bucket number to each row. |
PERCENT_RANK | Return the percent rank of a row in a set of rows. |
RANK | Return the rank of a row in a set of rows |
ROW_NUMBER | Assign a unique sequential integer starting from one to each row in a window partition |
Was this tutorial helpful ?