samedi 28 février 2015

SQlite reorder integer autoincrement when I delete some row

I have a SQLite database that have a table called Bookmarks. This table have an integer autoincrement column called Id.


Supose that I have three rows in this table, like this:



Id | Name
1 | Bookmark 1
2 | Bookmark 2
3 | Bookmark 3


If I delete the row 2, so I get this:



Id | Name
1 | Bookmark 1
3 | Bookmark 3


Anyone knows how can I reorder the Id sequence to get like this:



Id | Name
1 | Bookmark 1
2 | Bookmark 3


Justa an observation: I allready know how to restore the sqlite_sequence table sequence.


Tks for the help! =D


Aucun commentaire:

Enregistrer un commentaire