mybatis xml写left join
时间: 2023-10-11 16:09:49 浏览: 276
在MyBatis的XML中编写LEFT JOIN可以按照以下方式进行:
```xml
<select id="yourQueryId" resultType="YourResultType">
SELECT T1.*, T2.BNAME
FROM TA T1
LEFT JOIN TB T2 ON T1.BID = T2.ID
</select>
```
请注意,你需要将上述查询正确地集成到你自己的XML映射文件中,并根据你的需求修改查询的ID和结果类型。这个查询使用了"yourQueryId"作为查询的ID,并且使用"YourResultType"作为结果的类型。你需要根据你实际的情况修改这些值。
如果你有其他关于MyBatis的问题,请随时提问。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *2* [spring boot mybatis left join 或者right join](https://blog.csdn.net/wan903531306/article/details/120531237)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
- *3* [mybatis 简单实现 left join](https://blog.csdn.net/weixin_30326741/article/details/96265296)[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^v92^chatsearchT3_1"}}] [.reference_item style="max-width: 50%"]
[ .reference_list ]
阅读全文