select * from T_A a (nolock) where a.xh not in (select xh from T_B) 方法1:效果甚微 select * from T_A
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
--结束END--
本文标题: SQL Server 替换 not in 的用法
本文链接: https://lsjlt.com/news/7302.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-10-23
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
2024-10-22
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0