0

我有表:

CREATE TABLE Reports (
         _id INTEGER NOT NULL PRIMARY KEY,member_id INTEGER, 
      is_conf BOOLEAN,
         name TEXT, 
      started INTEGER,
finished INTEGER, description TEXT, obj_id INTEGER NOT NULL, FOREIGN KEY (obj_id) REFERENCES Objects (_id));
我想在哪里获取数据member_id = NULL
但是查询:
String sql = "SELECT _id, name FROM Reports WHERE member_id = NULL";
Cursor cursor = db.rawQuery(sql, null);

不起作用。

4

2 回答 2

5

您将需要使用这个:

String sql = "SELECT _id, name FROM Reports WHERE member_id IS NULL";
于 2013-01-04T23:14:00.503 回答
0

按照http://www.sqlite.org/lang_corefunc.html#ifnull文档中的说明使用 IFNULL

于 2013-01-04T23:14:39.800 回答