首页 > 数据库技术 > 详细

sql: left join vs. not in

时间:2018-10-22 16:24:04      阅读:148      评论:0      收藏:0      [点我收藏+]

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语句的执行结果集是一样的

sql: left join vs. not in

原文:https://www.cnblogs.com/printk/p/9830510.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!