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