I have table with the column name displayorders with values 1 to 250 and it’s not autoincrement.
Now I want to add a new row in table with displayorder = 3. So I don’t want to manually update all the values form 3 to 250.Instead of that I want to update all the displayorders to +1 and I can manually change from 1 to 2(ie 2 to 3 after updation).How can I do it through SQL Query?
If I understood correctly, you’d want to run an
UPDATEstatement like this:Test case:
Result after the
UPDATEstatement: