表:
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);
用這個就能解決:
String sql = "SELECT _id, name FROM Reports WHERE member_id IS NULL";