Many problems need each row numbered in some order, like the newest hire in each department or removing duplicate rows. ROW_NUMBER() gives every row a unique number based on an ORDER BY, restarting for each PARTITION BY group. Use it when you need exactly one row per position, even if values tie. If ties should share a position, use RANK or DENSE_RANK instead.