Question How to prevent dublicates in mysql database

Baraka_1989

Member
Joined
Mar 8, 2012
Messages
7
Programming Experience
Beginner
Hello geeks, am developing an application in vb.net that queries from a mysql database, in my tables called registration, the I'v set my primary key in an autoincrement manner, the problem that I face is how to reset the remaining keys in a proper ascending order after deleting some data in the table
 
No, you are not facing that problem. It is not a problem because you simply don't do it. You not supposed to do it. When you delete a record that record no longer exists, so that ID should no longer exist. You simply leave all the other values as they are. There's no reason to change anything. The IDs will still be in ascending order so there's no issue there. The fact that there's a "hole" in your list of IDs isn't hurting anyone, so just leave it.
 
Back
Top