sql: left join vs. not in

select * from product.login_info where username not in (select username from stat.totaluser)

vs.

select a.* from product.login_info as a left join stat.totaluser as b on a.username = b.username where b.username is null

上面2条sql语句的执行结果集是一样的

猜你喜欢

转载自www.cnblogs.com/printk/p/9830510.html