Real left outer join
How do I perform a real left outer join in mysql? it seems it's left outer join includes the inner join. I need to find records in table a
that are not in table b
.
select * from `a` where `a`.`index` not in (select `index` from `b`)
Is there any more optimized 开发者_运维问答way? without subquery maybe?
This is how you would do it w/ a left join:
select *
from `a`
left outer join `b`
on `a`.`index` = `b`.`index`
where `b`.`index` is null
精彩评论