我可以: 邀请好友来看>>
ZOL星空(中国) > 技术星空(中国) > MySQL星空(中国) > left join是怎么执行的呢?
帖子很冷清,卤煮很失落!求安慰
返回列表
签到
手机签到经验翻倍!
快来扫一扫!

left join是怎么执行的呢?

87浏览 / 2回复

340
精华
340
帖子

等  级:Lv.1
经  验:0
  • Z金豆:

    千万礼品等你来兑哦~快点击这里兑换吧~

  • 城  市:
  • 注  册:
  • 登  录:
发表于 2009-01-19 10:16:23
电梯直达 确定
楼主
索引有code 和 email WHERE a.code = '1' AND a.email = '2' and a.email = b.email如果inner join的话,explain结果会出现use where
id        select_type        table        type        possible_keys        key        key_len        ref        rows        Extra
1        SIMPLE        a        const        code,email        code        40        const        1         
1        SIMPLE        b        ref        email        email        30        const        1        Using where
ON a.email = b.email WHERE a.code = 'afcc91ce71b558d0b687dfbbe5e0b3ba490f281e' AND a.email = 'fff@ff.com'
如果用left join
id        select_type        table        type        possible_keys        key        key_len        ref        rows        Extra
1        SIMPLE        a        const        code,email        code        40        const        1         
1        SIMPLE        b        ref        email        email        30        const        1         
为什么呢?
谢谢

xgluyongit

xgluyongit


精华

帖子

等  级:Lv.5
经  验:4443
发表于 2009-01-19 10:16:23 1楼
using where 表示在引擎处理数据之前过滤数据。
没有则表示在之后。

110119linlin

110119linlin


精华

帖子

等  级:Lv.5
经  验:3697
发表于 2009-06-02 20:02:27 2楼
学习

netwenk

netwenk


精华

帖子

等  级:Lv.5
经  验:4484
发表于 2009-06-18 19:49:17 3楼

您的内容正在火速审核中,请稍等

高级模式
星空(中国)精选大家都在看24小时热帖7天热帖大家都在问最新回答

针对ZOL星空(中国)您有任何使用问题和建议 您可以 联系星空(中国)管理员查看帮助  或  给我提意见

快捷回复 APP下载 返回列表