SQL Server 替换 not in 的用法,sql中notin的用法
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
本站文章为和通数据库网友分享或者投稿,欢迎任何形式的转载,但请务必注明出处.
同时文章内容如有侵犯了您的权益,请联系QQ:970679559,我们会在尽快处理。