比如

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

 

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2021-06-15
  • 2022-12-23
  • 2022-12-23
  • 2022-02-10
  • 2021-06-10
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-08-30
  • 2022-12-23
  • 2021-12-04
  • 2021-12-10
相关资源
相似解决方案