Skip to content

Instantly share code, notes, and snippets.

@tairov
Created March 4, 2016 14:38
Show Gist options
  • Save tairov/97634b6395676854acc9 to your computer and use it in GitHub Desktop.
Save tairov/97634b6395676854acc9 to your computer and use it in GitHub Desktop.
mysql / counter in update
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