T-sql Reset Row number on Field Change

前端 未结 4 978
生来不讨喜
生来不讨喜 2020-12-10 03:58

Similar to a recent post of mine \"t-sql sequential duration\"”, but not exactly the same, I want to reset the row number based on a change in column x (in my case, column \

4条回答
  •  小蘑菇
    小蘑菇 (楼主)
    2020-12-10 04:35

    The only solution I can think of is to use a cursor (ugh) and suffer through the RBAR process. NOT an elegant solution as the cursor will have to read in excess of 1m rows. Bummer.

提交回复
热议问题