[Solved] Order Data in SQLite Android [closed]


You have an error concatenating your SQL statement:

String selectQuery = "SELECT * FROM " + TABLE_MURIDD + "ORDER BY" + COLUMN_NOMOR + "ASC";

should be:

String selectQuery = "SELECT * FROM " + TABLE_MURIDD + " ORDER BY " + COLUMN_NOMOR + " ASC";

EDIT: (Thanks to Michael Dogg)

A better way of protecting against this sort of thing would be to use String.format() e.g.

String selectQuery = String.format("SELECT * FROM %s ORDER BY %s ASC", TABLE_MURIDD, COLUMN_NOMOR);

solved Order Data in SQLite Android [closed]