之前我判断为空的时候,用的是:

select *
from a
where alex=' ' or alex != ' '

其实这样写是错误的,因为在sql中null值是特殊字符,所以不能用=号表示;

应该是:

select *
from a 
where alex is null or is not null

这样才是正确的写法;

相关文章:

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