sqlite - android: ORDER BY in query -
I have found an Android app using a local SQL database.
Private SQLiteDatabase mDb; When I run this query, I get my cursor over the rows with the pid equal to the id as desired:
mDb. Query (true, PT_TABLE, new string [] {KEY_PID, KEY_TID}, KEY_PID + "=" + ID, blank, empty, blank, empty, blank); When I run the following query, to get the same result set, I'm ordered by the pid " android.database.sqlite.SQLiteException: DataType Mismatch < / Strong> "
mDb.query (true, PT_TABLE, new string [] {KEY_PID, KEY_TID}, KEY_PID +" = "+ ID, blank, empty, blank, blank, KEY_PID + "DESC"); Any ideas?
It seems that according to a slightly mixed documentation, the last argument is that LIMIT section ORDER BY section.
Cursor query (Boolean separation, string table, string [] column, string selection, string [] selection marg, by string group, string string, string order by, // <- ORDER By the string limit) edit
But there is also another where order BY will be final < / P>
cursor query (string table, string [] column, string selection, string [] selection arrags, string group, string String, string command BI)
Comments
Post a Comment