Oracle Ranking Functions: ROW_NUMBER(), RANK(), DENSE_RANK() Explained
ROW_NUMBER() assigns unique sequential integers, RANK() skips ranks for ties, DENSE_RANK() assigns same rank to tied rows without gaps.
RANK(),ROW_NUMBER() and DENSE_RANK() ROW_NUMBER(): This function assigns a unique sequential integer to each row within a partition of a result set, starting at one for the first row in each partition. It does not account for ties; every row gets a unique number. RANK(): This function assigns a rank to each row within a partition of a result set, with the same rank given to rows with equal values. However, it skips ranks for tied rows. For example, if two rows share a rank of 1, the next rank assigned will be 3. DENSE_RANK(): Similar to RANK(), this function assi...