How do I order my SQLITE database in descending order, for an android app?

Query has two syntax, the syntax you are using, last column represents orderBy, you just need to specify on what column you want to do orderBy +”ASC” (or) orderBy +”DESC”

Cursor c = scoreDb.query(DATABASE_TABLE, rank, null, null, null, null, yourColumn+" DESC"); 

Refer this documentation to understand more about query() method.

Leave a Comment