Skip to content

Instantly share code, notes, and snippets.

@marcphilipp
Created July 29, 2014 06:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save marcphilipp/75bed875730ac2a6b288 to your computer and use it in GitHub Desktop.
Save marcphilipp/75bed875730ac2a6b288 to your computer and use it in GitHub Desktop.
IndexColumn migration script
update tbl t1
set t1.reihenfolge = (with t3 as
(select t2.id, row_number() over (partition by modell order by bo) nr
from tbl t2)
select nr from t3
where t3.id = t1.id)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment