我有桌子:
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);
不起作用。
答案 0 :(得分:5)
你需要使用它:
String sql = "SELECT _id, name FROM Reports WHERE member_id IS NULL";
答案 1 :(得分:0)