为什么我在sqlite
中使用IS NULL
时无法调用空数据行
select roomkeyID from roomkey where dateOfReturn is null;
CREATE TABLE ROOMKEY (
roomkeyID VARCHAR(10) not null primary key,
roomID VARCHAR(10) not null,
keyID VARCHAR(10) not null,
dateOfIssue DATETIME,
dateOfReturn DATETIME,
FOREIGN KEY (roomID) REFERENCES ROOM(roomID),
FOREIGN KEY (keyID ) REFERENCES KEY(keyID )
)
"RK000001","R106","K0003","12/17/2015"," "
"RK000090","R101","K0002","12/12/2015"," "
答案 0 :(得分:0)
从示例中可以看出,在dateOfReturn
字段中,您没有NULL
值,而是内部有空格的字符串。如果是这样,那么您必须将查询更改为:
select roomkeyID from roomkey where dateOfReturn is null or dateOfReturn = ' '