Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

Reorder Table Primary Key Index After Deleting Some Rows

UPDATE tbl SET catid = (SELECT COUNT(*) FROM tbl t WHERE t.catid <= tbl.catid);
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #Reorder #Table #Primary #Key #Index #After #Deleting #Some #Rows
ADD COMMENT
Topic
Name
1+4 =