I have a table with 3 columns.(Id-Primary Key, Task-string, due date-string). i want to insert task and set due date. Then, i want to display them in list view.Before i display them in list view, i want this table sorted based on date from most recent to least.
Asked
Active
Viewed 686 times
-2
-
1`I know how to sort just a column, but i want to sort entire table` what does this mean? Simply retrieve the whole table and sort it on the date column. – Phantômaxx Feb 24 '17 at 17:15
-
http://stackoverflow.com/a/14091321/2620080 – ScieCode Feb 24 '17 at 17:23
-
1Possible duplicate of [SQLite Order By Date](http://stackoverflow.com/questions/14091183/sqlite-order-by-date) – Hywel Rees Feb 24 '17 at 17:53
1 Answers
0
Cursor cursor = db.query(DATABASEHelper.DATABASE_TABLE,
result_columns, where,
whereArgs, groupBy, having, order);
so argument order will be "COLUMN_NAME ASC"

Gurwinder Singh
- 38,557
- 6
- 51
- 76

Elsunhoty
- 1,609
- 14
- 27