【发布时间】:2015-03-06 09:57:50
【问题描述】:
我正在尝试更新我的表,但它给了我错误如何在 Where 子句中使用 AND 运算符进行更新?
这是我的代码;
public static void updateData(long lday, String id, String usedamount, String trashedamount) {
// TODO Auto-generated method stub
ContentValues updatedValues = new ContentValues();
updatedValues.put("usedamount", usedamount);
updatedValues.put("trashedamount",trashedamount);
// HERE I WANT TO USE AND OPERATOR FOR DAY AND ID
// this and operator gives error
db.update("info_table", updatedValues, DAY + "=" + lday AND ID + "=" + id, null);
}
谁能帮帮我?
【问题讨论】:
-
它不会更新这段代码 db.update("info_table", updatedValues, DAY + "=" + lday AND ID + "=" + id, null);
-
是编译器错误吗?
-
编辑您的问题并添加您收到的确切错误消息。
-
我的意思是你在这里遇到什么异常?分享例外
-
它说在这一行有多个标记 - lday 的原始类型 long 没有字段 ID
标签: android sqlite where-clause