比如
insert into table a (a1,b1)values("a1",'');
對於這種情況,因為表里存的是'',其實是沒有內容的,要查詢這個字段,不能直接使用
select * from a where b1='';
sql中判斷非空不能用等號,因為null在sql中被看作特殊符號,必須使用關鍵字 is和not
應該如此使用:
select * from A where b1 is null 或者: select * from A where b1 is not null
比如
insert into table a (a1,b1)values("a1",'');
對於這種情況,因為表里存的是'',其實是沒有內容的,要查詢這個字段,不能直接使用
select * from a where b1='';
sql中判斷非空不能用等號,因為null在sql中被看作特殊符號,必須使用關鍵字 is和not
應該如此使用:
select * from A where b1 is null 或者: select * from A where b1 is not null
本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。