Reputation: 148169
I'm using SQLite DB in my Android app.
Now I need to implement data extraction in the same order in which it was inserted.
Is it enough to do SELECT ... ORDER BY _id ...
if the _id
column is INTEGER PRIMARY KEY AUTOINCREMENT
?
Or should I add a column to store the date and time a row has been created?
Upvotes: 0
Views: 74
Reputation: 122
You can use ORDER BY _id
. Make sure you are using a List and not a Set....
Upvotes: 1
Reputation: 37
Yes, if you just need the order, you may use such statement or just simple "SELECT ... FROM sometable". Results will be equals.
Upvotes: 1