views:

36

answers:

2

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?

+2  A: 

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.

Jasarien
+1  A: 

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";
Vladimir
where in my code do i put these lines?
Steve
You need to add the `order by score asc` part to wherever in your code you are accessing the scores. IE right now in your code, how are you accessing the list of scores? Add `order by score` to that SQL query.
David Oneill
i got it. when i use desc, it works, but changing it to asc makes the scores not show up in the table....
Steve