1 vote
Accepted

Trying to renumber a field in order grouping by another

For an UPDATE query you don't need to rejoin, you can update the derived table directly UPDATE T SET sequence = RowNum FROM ( SELECT T.*, row_number() OVER (PARTITION BY C.co ORDER ...
Charlieface's user avatar
  • 12.9k

Only top scored, non community-wiki answers of a minimum length are eligible