Tag archive
Commands grouped around the same concept, pattern, or recurring problem.
Create stable run groups without a primary key by subtracting two `ROW_NUMBER()` calculations over the same ordered events.
Assign sequential integers to rows within a partition without collapsing the result set the way `GROUP BY` does.
Use `ROW_NUMBER()` to rank rows within each group and keep only the highest-ranked row.