I have a question about fixing a non-contiguous data that I've:
Let's say I have this table:
Now for name "ABC" and "XYZ" I've non-contiguous number. I need to find the number that are missing for those two name and make them contiguous So that
@ThomasRushton's answer is correct (+1) but can be refactored down to a more concise version:
I have wrapped the original data into a CTE
This saves a join and just resorts the data, so should be a little better on resources (don't forget to test though!)
answered Aug 13, 2012 at 06:19 AM
Hope that helps.