`

sql 关于in 和EXISTS 的区别

SQL 
阅读更多
in 不匹配 null 值,
EXISTS 匹配 null值。

下面的例子不能运行:
select count(*)  from (select p5 from wgqtest where not  EXISTS(select a.emp_code from base_employee a))

select count(*) from wgqtest where p5 in (select a.emp_code from base_employee a)
select count(*) from wgqtest where p5 not in (null)
select count(*) from wgqtest where p5 is not null

select a.emp_code from base_employee a where emp_code is null

select p5 from wgqtest



分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics