I want to select the rows that match the passed eta, category and class, attributes but that doesn't contains the passed use1 and use2 attribute, so I have written this code
public Cursor getData(String use1, String use2, String eta, String category,
String class) {
try {
Cursor c;
c = mDb.rawQuery(
"SELECT * FROM dbtable "
+ "WHERE Use NOT LIKE ? AND Use NOT LIKE ? AND Eta LIKE ? AND Language LIKE ? ORDER BY Name",
new String[] { "%" + use1 + "%", "%" + use2 + "%", "%" + eta + "%",
"%" + language + "%" });
if (c != null) {
c.moveToNext();
}
return c;
} catch (SQLException mSQLException) {
Log.e(TAG, "getDataCar >>" + mSQLException.toString());
throw mSQLException;
}
}
Unfortunately doesn't work, and doesn't exclude the rows that contains the attributes use1 and use2, if I remove the two NOT LIKE conditions, works fine... so there is a syntax error with the two NOT LIKE conditions.