Created
February 18, 2011 20:15
-
-
Save jpadilla/834329 to your computer and use it in GitHub Desktop.
Re-calculate's primary index id
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
set @primary_key := 0; | |
UPDATE `table_name` SET `id` = @primary_key := @primary_key + 1 ORDER BY `id`; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment