243 Star 2.7K Fork 562

MyBatis-Flex/MyBatis-Flex

feat: QueryWrapper 添加 with 的语法构建支持

已完成
拥有者
创建于  
2023-06-16 14:54

问题描述

目前 QueryWrapper 不支持构建 with 。

With 的语法如下:

[WITH [RECURSIVE] with_query [,…] ] SELECT …
With 
	Subtable1 as (select 1...),
	Subtable2 as (select 2...), 
	Subtablen as (select n...) 
Select …

With 的使用示例

with tmp as (
select empno ,ename ,sal 
from db_hive.emp)
select t.empno,t.ename,t.sal from tmp t ;

评论 (2)

Michael Yang 创建了任务 2年前

有 with 的话,记得 count 查询也要优化!

61279 fuhai 1716893681 Michael Yang 拥有者
回复 王帅 成员
2年前

count 保留现在就可以的,否则会造成低版本数据库不支持 with 语法的情况。

Michael Yang 通过 mybatis-flex/mybatis-flex Commit e780c14任务状态待办的 修改为已完成 2年前

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
7984572 suomm 1698661375 61279 fuhai 1716893681
1
https://gitee.com/mybatis-flex/mybatis-flex.git
git@gitee.com:mybatis-flex/mybatis-flex.git
mybatis-flex
mybatis-flex
MyBatis-Flex

搜索帮助