Skip to content

Instantly share code, notes, and snippets.

@febridev
Created July 23, 2017 11:51
Show Gist options
  • Save febridev/3c53c85a72612b52d651298af78a09c2 to your computer and use it in GitHub Desktop.
Save febridev/3c53c85a72612b52d651298af78a09c2 to your computer and use it in GitHub Desktop.
update loop id mysql
set @newid=0;
update users set ID = (@newid:=@newid+1) order by ID;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment