I want to make a query such that the result will be shown in indistinct descending order.
For example, assume column ID has six rows. I need an quer
You need to add an ORDER BY ID DESC
to your select statement.
ORDER BY
You can write like this:
Cursor cursor = db.rawQuery("SELECT * FROM " + TABLE_NAME+"
WHERE "+STATUS+" = "+"'0'" + " ORDER BY id DESC LIMIT 10", null);
return cursor ;
Use following statement....
select * from YOUR_TABLE_NAME ORDER BY ID DESC;
/* In the most simple and basic way, you can write it as */
SELECT ID FROM your_table_name ORDER BY ID DESC;
/* This should work fine with your problem and should give you your desired output */