Created
March 4, 2016 14:38
-
-
Save tairov/97634b6395676854acc9 to your computer and use it in GitHub Desktop.
mysql / counter in update
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 @pos := 0; | |
update coins set list_order = (select @pos := @pos + 1 as pos) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment