Reset numbering of rows

h4waiianPunch's profile image h4waiianPunch posted 8 months ago in General Permalink

Hi there,

I have a table with 50 some odd rows, I've deleted some of the rows in-between, and may need to move some rows around, I was wondering if there was a way to reset the numbering for all of the columns. There's a script that requires them to be ordered correctly, AND I like it to look nice.

Essentially, it would remove the current numbers in the "id" field, which is the key in my case, and then re-number them starting at 1 going down the list.

Thanks!

notHeidi's profile image notHeidi posted 8 months ago Permalink

You can simply remove the ID column (and key - presumably it's your primary key for this table), then add it again with AUTOINCREMENT as the default, and set it as the primary key.

Please login to leave a reply, or register at first.