Skip to content

Instantly share code, notes, and snippets.

@ErDmKo
Created October 22, 2013 16:00
Show Gist options
  • Save ErDmKo/7103316 to your computer and use it in GitHub Desktop.
Save ErDmKo/7103316 to your computer and use it in GitHub Desktop.
Django extra row number column for mySQL ROW_NUMBER()
Obj.objects.extra(select={'num': "(select @f2 := @f2 +1 from (select @f2 := 0) as t )"})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment