I have a table of 5700 records. The primary key is an integer. Now I noticed that some values are missing. Like this:
100 data
101 data
102 data
104 data
103 is missing. How I can update all the rows so that the order becomes correct (104 becomes 103 in my example) in one SQL command?
Not sure about one command, but you can do it in four commands:
Unless you’re doing this to make it easier to select records randomly, you really should rethink your approach.