Jump to content

data structuring help


hakimserwa

Recommended Posts

I'm not sure why you'd want to do this, but.... anyway, this could be work if the id table is auto_increment.

Check this out -> http://stackoverflow.com/questions/740358/mysql-reorder-reset-auto-increment-primary-key

SET @count = 0;
UPDATE `tbl_name` SET `tbl_name`.`id` = @count:= @count + 1;

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.