I am trying to remove 6 rows from the database using the following statement but I get the error shown below.
getWritableDatabase().execSQL("DELETE FROM tblname ORDER BY _id ASC LIMIT 6;");
Error:
Caused by: android.database.sqlite.SQLiteException: near "ORDER": syntax error: DELETE FROM tblname*
I tried reformatting the SQL in different ways but couldn’t get it to work. What am I missing?
I think your problem may have been quoting the
_id, though.