SQL Server 替换 not in 的用法

亡梦爱人 提交于 2020-08-13 07:12:10

select * from T_A a (nolock) where a.xh not in (select xh from T_B)

方法1:效果甚微

select * from T_A a (nolock) where not exists (select xh from T_B where xh=a.xh)

方法2:效果比想象的要好。

select * from T_A a (nolock) left join T_B b on b.xh=a.xh where b.xh is null

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!