这里有三条sql语句,想找到存在tblA中,却又不在tblB中的记录数

select count*from tblA
select count(*from tblA where pid in ( select pid from
 tblB)
select count(*from tblA where pid not in  select pid from tblB)今天发现了一个sql的小问题
结果运行的结果是
今天发现了一个sql的小问题1070
按理应该是 10,7,3 才对阿,
后来才发现最后一句应该这样写
今天发现了一个sql的小问题select count(*from tblA where pid not in (select pid from tblB where pid is not null)

运行后的结果才对:10,7,3
只是不知道为什么最后一句不取掉空项就select 不出来

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-09-04
  • 2021-09-22
  • 2022-12-23
  • 2021-09-24
  • 2022-03-07
  • 2022-12-23
猜你喜欢
  • 2021-06-24
  • 2022-03-07
  • 2021-06-21
  • 2022-01-17
  • 2022-12-23
  • 2022-03-02
  • 2022-02-06
相关资源
相似解决方案