Table has 2 cols: [nr] and [diff]
diff is empty (so far - need to fill)
nr has numbers:
1
2
45
677
43523452
on the diff column i need to add the differences between pairs
1 | 0
2 | 1
45 | 43
677 | 632
43523452 | 43522775
so basically something like :
update tbl set diff = @nr - @nrold where nr = @nr
but i don't want to use fetch next, because it's not cool, and it's slow (100.000) records
how can I do that with one update?