I tried to search a record in Android SQLite whether the record exists in any other column "ITEM_NAME" or column "ITEM_CODE". it never works.
mCursor = mDb.query(true, ITEM_TABLE_NAME, new String[] {ITEM_ID, ITEM_CODE,
ITEM_NAME, ITEM_CPRICE, ITEM_UPRICE},
ITEM_NAME + " like '%" + inputText + "%'"
+ "OR" + ITEM_NAME + " like '%" + inputText + "%'" , null,
null, null, null, null);
But searching in one coulumn works
mCursor = mDb.query(true, ITEM_TABLE_NAME, new String[] {ITEM_ID, ITEM_CODE,
ITEM_NAME, ITEM_CPRICE, ITEM_UPRICE},
ITEM_NAME + " like '%" + inputText + "%'"
null, null, null, null);
Aucun commentaire:
Enregistrer un commentaire