For example, I inserted 2 rows into database: first with “1” _ID and second with “2” _ID. If I delete the second row and insert a new one it will have “2” _ID again. Is it possible to set rule for database which increase _ID always? In my case, a new one will have “3” _ID instead of “2”. Thank you in advance.
Share
You can use the
AUTOINCREMENTkeyword on your_IDcolumn. This will guarantee that automatically chosen ROWIDs will be increasing.From the SQLite documentation: