Reputation: 79
I was previously using SQL CE and have decided to move over to SQLite.
With that being said, SQL CE allowed me to auto increment an id by 2.
Is this is possible with SQLite?
Upvotes: 1
Views: 39
Reputation: 180060
SQLite has no mechanism to do this automatically.
But you can calculate the new ID manually while inserting:
INSERT INTO MyTable(ID, Name, Number)
VALUES((SELECT MAX(ID) + 2 FROM MyTable),
'me', 42);
Upvotes: 1