我已经通过android为sqlite db中的select过滤数据编写了这段代码。但它说有一些错误。你能帮我改正一下我的代码吗?
category = data[0];
district = data[1];
SQLiteDatabase db = openOrCreateDatabase("dbumbers", 1, null);
Cursor c = db.rawQuery("SELECT * FROM numbers where [category = '"+category+"'] and [district = '"+district+"']", null);
答案 0 :(得分:0)
你应该用这个:
Cursor c = db.rawQuery("SELECT * FROM numbers where category = '"+category+"' and district = '"+district+"'", null);
您必须从查询中删除[]