我在尝试搜索SQLite数据库的多个列时遇到了问题。 这是我目前的代码
String whereClause;
if (!suchwort.contains("%")){ // Abfrage mit Wildcard?
whereClause = WoerterbuchContract.WoerterbuchEintraege.COLUMN_NAME_WORT_DEUTSCH
+ " = '"+suchwort+"'" ;}
else {
whereClause = WoerterbuchContract.WoerterbuchEintraege.COLUMN_NAME_WORT_DEUTSCH
+" like '"+suchwort+"'";}
Cursor ergCursor = db.query(
WoerterbuchContract.WoerterbuchEintraege.TABLE_NAME, // The table to query
projection, // The columns to return
whereClause, // WHERE clause
null, // no values for the WHERE clause
null, // don't group the rows
null, // don't filter by row groups
sortOrder // The sort order
);
我尝试在whereClause中添加列,但我总是遇到编译错误。