Tag archive
Commands grouped around the same concept, pattern, or recurring problem.
Assign sequential integers to rows within a partition without collapsing the result set the way `GROUP BY` does.
Assign rank numbers to rows within a partition, controlling whether tied ranks leave gaps in the sequence.
Use `ROW_NUMBER()` to rank rows within each group and keep only the highest-ranked row.