Last active
August 29, 2015 14:11
-
-
Save alancoleman/12b1693f94584163f8e2 to your computer and use it in GitHub Desktop.
Update a table column with an incremented value
This file contains 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
UPDATE table AS t | |
SET t.id = ''; | |
SET @rank:=0; | |
update table AS t | |
set t.id =@rank:=@rank+1 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment