摘要: 1 我们总是习惯了用in 和 not in 但是这样有时会会很影响性能,下面来看看用exists 和 not exists 的使用方法 首先新建两张表 a 和 b select a.* from a where exists (select * from b where a.value = b.va 阅读全文
posted @ 2017-03-10 19:00 小琪子 阅读(889) 评论(0) 推荐(0)
摘要: 首先我们新建两张表 a 和 b a 表数据 b 表数据 我们根据 value 来左连接 select a.*,b.* from a left join b on a.value = b.value 我们 看到 根据a 表,b表能匹配的都补全 那我们看看 b 表 左连接 a 表的 select b.v 阅读全文
posted @ 2017-03-10 18:41 小琪子 阅读(2411) 评论(0) 推荐(0)