sql server中in和exists的小区别 oracle未测试
2009-10-28 16:34
731 查看
in 的话, 如果是null 就不比较了,既不是in 也不是 not in
exists的话 因为用 = 加在条件里比较了,所以 null 是 not exists
select *
from pricetemp
where cast(商品コード as varchar(10))not in(
select shohin_cd
from m_price)
select *
from pricetemp
where not exists (select shohin_cd
from m_price
where cast(pricetemp.商品コード as varchar(10))=m_price.shohin_cd)
以上2条会有不同的结果,因为 pricetemp.商品コード 有很多 null
exists的话 因为用 = 加在条件里比较了,所以 null 是 not exists
select *
from pricetemp
where cast(商品コード as varchar(10))not in(
select shohin_cd
from m_price)
select *
from pricetemp
where not exists (select shohin_cd
from m_price
where cast(pricetemp.商品コード as varchar(10))=m_price.shohin_cd)
以上2条会有不同的结果,因为 pricetemp.商品コード 有很多 null
相关文章推荐
- 关于Oracle中in和exists的区别
- oracle中exists和in的区别和效率比较
- Oracle中的EXISTS与IN使用区别
- 关于Oracle中exists和in的区别
- ORACLE in与exists语句的区别(一)
- Oracle中exists与in区别
- oracle中in,not in和exists,not exists之间的区别
- oracle中in和exists区别
- oracle-exists和in的区别
- oracle 11G 实验 in 和 exists 区别
- ORACLE in与exists语句的区别
- Oracle exists/in和not exists/not in之前的区别与联系
- Oracle exists和in区别比较
- ORACLE in与exists语句的区别
- oracle 中exists,not exists的用法以及和exists和in的区别
- ORACLE中EXISTS和IN进行子查询的区别(工作原理分析)
- Oracle 条件语句 in和exists 区别
- oracle 优化or 更换in、exists、union all几个字眼,测试没有问题!
- Oracle exists 和 in 的真正区别
- oracle中in和exists区别