Suppose I have a table like this
ID Name
1 RJ
2 Hello
3 NV
4 Dere
5 What
So when I am deleting the fourth entry from the database ( ID=4 and Name= dere ) by using this Sql Statement
Delete from Table where ID="4"
then it deletes the table row but when I see the table it looks to me as
ID Name
1 RJ
2 Hello
3 NV
5 What
So is there any way that it also updates the auto increment ID automatically like I want the table to look like this as soon as I delete the table fourth entry
ID Name
1 RJ
2 Hello
3 NV
4 What
Hope you have got to know my question..!!
No. This would involve updating potentially hundreds of thousands of records. Your code shouldn’t require that keys be contiguous. You should never assume anything about the keys.