Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

APIJSON支持left join 、union all、子查询等其他复杂sql吗 #98

Open
zhangxiaozhang opened this issue Jul 8, 2019 · 2 comments
Open
Labels

Comments

@zhangxiaozhang
Copy link

@zhangxiaozhang zhangxiaozhang commented Jul 8, 2019

环境信息

  • 系统:
  • JDK:
  • 数据库:
  • APIJSON:

问题描述

错误信息

@TommyLemon
Copy link
Member

@TommyLemon TommyLemon commented Jul 8, 2019

JOIN 和 子查询 见 3.2 功能符
https://github.com/APIJSON/APIJSON/blob/master/Document.md#3.2

目前还不支持 UNION ALL,可以用主副表条件 OR 连接的 INNER JOIN 替代("join": "/ViceTable/refKey@")
也可以在建议收集箱加一个新增功能的建议
#37

@gsqatm
Copy link

@gsqatm gsqatm commented May 6, 2020

JOIN和子查询见3.2功能符
https://github.com/APIJSON/APIJSON/blob/master/Document.md#3.2

目前还不支持UNION ALL,可以用主副表条件或连接的INNER JOIN替代(“ join”:“ / ViceTable / refKey @”)
也可以在建议收集箱加一个补充功能的建议
#37
LEFT JOIN中,除了主表,其他表为何要先建立临时表?
例如:
{
"[]": {
"join": "</User/id@,</Comment/momentId@",
"Moment": {},
"User": {
"name~": "t",
"id@": "/Moment/userId"
},
"Comment": {
"momentId@": "/Moment/id"
}
},
"@Explain": true
}

SQL:
SELECT Moment., User., Comment.* FROM apijson_demo.Moment AS Moment LEFT JOIN ( SELECT * FROM apijson_demo.apijson_user WHERE ( (name REGEXP BINARY 't') ) ) AS User ON User.id = Moment.userId LEFT JOIN ( SELECT * FROM apijson_demo.Comment ) AS Comment ON Comment.momentId = Moment.id LIMIT 10 OFFSET 0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.