sql查询exist替换in

很多时候用 exists 代替 in 是一个好的选择: 
select num from a where num in(select num from b) 
用下面的语句替换: 
select num from a where exists(select 1 from b where num=a.num) 

posted @ 2017-10-16 12:04  桃花雪  阅读(2143)  评论(0编辑  收藏  举报