Android上的SQLite查询出错

时间:2012-12-12 08:54:27

标签: android sqlite

我的代码:

Cursor mCursor = mDB.query(true, DB_TABLE, new String[] {NUMBER, INVOICEID, SNAME, NUMBERPHONE, ADDRESS, URL, STATUS, IDDELIVER }, IDDELIVER + "='" + iddeliver+"'" + "AND"+ STATUS+"='Chuagiao'", null, null, null, null, null);

我在位置上不假?

2 个答案:

答案 0 :(得分:2)

试试这个:

Cursor mCursor = mDB.query(true, DB_TABLE, new String[] {NUMBER, INVOICEID, SNAME, NUMBERPHONE, ADDRESS, URL, STATUS, IDDELIVER }, IDDELIVER + "='" + iddeliver+"'" + " AND "+ STATUS+"='Chuagiao'", null, null, null, null, null);

答案 1 :(得分:2)

我想你忘记了"AND"

中的空格

您的查询应如下所示:"iddeliver AND STATUS='Chuagio'

目前它看起来像这样:"iddeliverANDSTATUS='Chuagio'