The RANK() function is a window function that assigns a rank to each row within a partition of a result set. The rows within a partition that have the same values will receive the same rank. The rank of the first row within a partition is one.
Partition by (+add):
- Def: Specify the column for grouping.
Order by (+add):
- Def: Specify the column for ordering.
- Def: Specify the function to use.
- Def: Specify the size of rows.
- Def: Specify the name of the column.
- Def: Returns a rank to each row in the partition of a result set. The rank of a row is determined by one plus the number of ranks that come before it.
- Def: Returns a rank to each row in the partition of a result set. The rank values are not skipped in case of ties.
- Def: Distributes rows of an ordered partition into a specified number of approximately equal groups. It assigns each group a bucket number starting from one to N.
- Def: Returns the percentile ranking of rows in a result set : percent_rank = (rank - 1) / (total_rows - 1).
- Def: Returns a sequential integer to each row of a query’s result set. Rows are ordered starting from one based on the order specified by the ORDER BY clause in the window definition.