当我以这种方式进行查询时
String where = "_id in(select phrase_id from words where word like '%FIRST%' intersect select phrase_id from words where word like '%SECOND%')";
Cursor cursor = database.query(PHRASES_TABLE, columns, where, null, null, null, null);
它工作正常。但是当我尝试使用 selectionArgs 而不是硬编码值时
String where = "_id in(select phrase_id from words where word like '%?%' intersect select phrase_id from words where word like '%?%')";
String[] args = {"FIRST", "SECOND"};
Cursor cursor = database.query(PHRASES_TABLE, columns, where, args, null, null, null);
我抓住
android.database.sqlite.SQLiteBindOrColumnIndexOutOfRangeException: bind or column index out of range: handle 0x10b71e0
谢谢。