开发者

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.

The best I could come up with is

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
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜