I am trying to delete last inserted Item from database table, but always getting SQLiteException: near "ORDER" syntax error (code 1)
android.database.sqlite.SQLiteException: near "ORDER": syntax error (code 1): , while compiling: delete from pending where url = 'server' and mobile_id = '2331' and sent = '0' ORDER BY id DESC LIMIT 1
Using following query:
db.execSQL("delete from pending where url = 'server' and mobile_id = '" + string + "' and sent = '0' ORDER BY id DESC LIMIT 1");