RANK vs DENSE_RANK vs ROW

SQL
Author

Imad Dabbura

Published

January 21, 2023

SELECT ROW() OVER(PARTITION BY attrib_1 ORDER BY attrib_2)

ROW(), RANK(), and DENSE_RANK() all share the same functionality, which is assigning numbers to tuples inside a partition ordered by some attribute(s). However, they are different in terms of assigning those numbers in the case of ties: