LambdaQueryWrapper使用子查询
时间: 2023-10-15 14:25:34 浏览: 123
sqlserver 子查询语句
在使用LambdaQueryWrapper进行子查询时,可以使用`inSql`方法来实现。通过在子查询中构建LambdaQueryWrapper对象,然后使用`inSql`方法将子查询的结果作为条件进行查询。这样可以避免手写SQL,使代码更加简洁易读。需要注意的是,在使用LambdaQueryWrapper之前,需要在项目中引入MyBatis-Plus的Lambda模块。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* [LambdaQueryWrapper构建查询条件](https://blog.csdn.net/weixin_42133138/article/details/126360147)[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%"]
- *2* *3* [使用mybatisPlus的queryWrapper进行子查询(以及传统xml方式做leftjoin)](https://blog.csdn.net/weixin_42759398/article/details/130498273)[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 ]
阅读全文