sqlserver exists 与 in 的区别

使用 EXISTS 方式

select * from A  a where EXISTS(select b.mainInfoId from B b  where b.mainInfoId=a.mainInfoId); 

使用 in  方式
select * from A where id in (select id  from B);

posted @ 2019-08-29 22:27  明天,你好啊  阅读(3695)  评论(0编辑  收藏  举报