mysqll的left join与right join的差异
时间: 2023-10-12 19:05:58 浏览: 82
left join和right join是MySQL中的两种不同的连接方式。
left join会选择左边的表作为驱动表,也就是左边的表是主导的,然后将右边的表与驱动表进行匹配,返回匹配成功的记录,如果右表中没有匹配的记录,返回NULL值。换句话说,left join会返回左表中的所有记录以及与之匹配的右表中的记录。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [项目中常用的19条MySQL优化](https://blog.csdn.net/weixin_33511258/article/details/114342565)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
- *3* [Mysql数据库设计](https://blog.csdn.net/xing_jian1/article/details/123442544)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文