欢迎投稿

今日深度:

SQL Server 替换 not in 的用法,sql中notin的用法

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

www.htsjk.Com true http://www.htsjk.com/Sql_Server/43137.html NewsArticle 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 notexists(select xh from T_Bwherexh=a.xh) 方法2:效果...
相关文章
    暂无相关文章
评论暂时关闭