Cursor cursor = database.query(MySqliteOpenHelper.TABLE_MOTS, allColumns,
MySqliteOpenHelper.COLUMN_CAT + " = ? AND " + MySqliteOpenHelper.COLUMN_MOT + " LIKE ?",
new String[] {cat, c + "%"},
null, null, null, null);
知道: -MySqliteOpenHelper.TABLE_MOTS:表名 -allColumns是一个带有列名称的String表 -MySqliteOpenHelper.COLUMN_CAT:列名(用于where条件) -MySqliteOpenHelper.COLUMN_MOT:另一个列名(也适用于条件)
并且知道我想要的sql查询,例如:
select * from mots where cat = 'jobs' and mot like "s%"