I created a database, display the data in the ListView, experiment, decided to display the sorted data in descending / increasing order (not so important). Actually, with this record:

public Cursor getAllDate() { return refillDB.query(DB_TABLE, null, null, null, null, null, COLUMN_COINS); } 

All data is correctly sorted in ascending order, but in the textbook where I found it it is written: D. Griffiths. Head First. Programming for Android.

making a request in accordance with the textbook:

  public Cursor getAllDate() { return refillDB.query(DB_TABLE, null, null, null, null, null, "COLUMN_COINS ASC"); } 

gives the error E / SQLiteLog: (1) no such column: COLUMN_COINS.

Already the whole head was broken, because other sorting methods do not work, only the standard "ascending".

    1 answer 1

    It writes in black and white that it cannot find the column COLUMN_COINS in the table. most likely your constant COLUMN_COINS has a different meaning. so write not "COLUMN_COINS ASC" and COLUMN_COINS + " ASC"

    • thank you, it works. I still could not understand the correct spelling of the request, because in the textbook that punctuation is different = _ = - Howling