I am building an android application where I am using data helper class to store the data.
Now the problem I am facing is How can I delete top old 10 data from table.
I am using below query but my application crashed.
public void deleteRec() {
String ALTER_TBL ="delete from " + TBL_NAME +
" order by _id LIMIT 3);";
db.execSQL(ALTER_TBL);
}
And calling using -
new DatabaseHelper(getApplicationContext()).deleteRec();
