开发者

iPhone SQLite tracking scores in a table

I have an sqlite table in开发者_运维问答 my game that keeps track of scores. How do I make one of the columns track scores in ascending order instead of descending order?


The order of the data in the table itself is irrelevant, it's how you order it when retrieving it via a query is what matters.

In that case, in your SQL select statement, you can add the clause ORDER BY "column_name" ASC where column_name is the column you want to order by.


The order your scores are saved in database is not relevant - you can specify the order you need in SQL query:

@"SELECT * FROM scoretable order by score asc";
@"SELECT * FROM scoretable order by score desc";
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜