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 \
I had success with this issue by using Rank():
SELECT RANK() OVER (PARTITION BY who ORDER BY custno, moddate) AS RANK
This returned your desired results. I actually found this post trying to solve the same problem.