I am trying to remove certain rows of a table in Android. I tried running directly through the SQL command "execSQL" and "rawQuery". Right now I'm using "db.delete" where I step in the argument "where" the rows that I want to remove.
This is the code:
String where = DBTables.TActivities.ID + " NOT IN ( " +
" SELECT " + DBTables.TInscripcionesActividades.ID_ACTIVIDAD + " FROM " +DBTables.TInscripcionesActividades.TABLE_NAME + " );";
db.beginTransaction();
db.delete(DBTables.TActivities.TABLE_NAME, where, null);
db.endTransaction();
I tested the sql petition in a BBDD browser and it works fine.
I want to delete all records of the table "TActividades" except the activities whose IDs are in the "TInscripcionesActividades" table.
Any ideas?? Thanks in advance!