0

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?

4

3 回答 3

1

不用了,一个AUTOINCREMENT生成的id就够了。

于 2013-11-10T19:34:06.840 回答
1

是的,如果您只需要订单,您可以使用这样的语句或只是简单的“SELECT ... FROM sometable”。结果将是平等的。

于 2013-11-10T19:34:26.150 回答
1

您可以使用ORDER BY _id. 确保您使用的是 List 而不是 Set....

于 2013-11-10T19:31:56.913 回答