I am basically just trying to add 1 to a column in every row of the table whos primary key is not the minimum. I placed the code below. Can someone help me out with the logic?
UPDATE MyTable
SET LineNumber = (case when TableID != min(TableID) then LineNumber + 1)
FROM MyTable
1 Answer