我想从两个表列中的任何一个列中搜索我的数据但是以下代码无法正常工作我该怎么办?
Cursor c = queryBuilder.query(ourHelper.getReadableDatabase(),
new String[] { "_ID", SearchManager.SUGGEST_COLUMN_TEXT_1, SearchManager.SUGGEST_COLUMN_TEXT_2, SearchManager.SUGGEST_COLUMN_INTENT_DATA_ID }, KEY_ADDRESS + " like ? " + " OR " + KEY_ROWID + " like ? ", selectionArgs, null, null, KEY_ADDRESS + " asc ", "10");
答案 0 :(得分:0)
兄弟,这很容易......我希望它适用于你的where子句
String where = KEY_ADDRESS + "=" + variable + " and " + KEY_ROWID + "='" + var_id + "'";
Cursor c = mDb.query(true, TABLE_MENUS, new String[] { your column name}, where, null, null, null, null, null);