APIJSON
APIJSON copied to clipboard
子查询中没办法引用父查询的字段
环境信息
- 系统: Windows 10
- JDK: 1.8.0_17
- 数据库: MySQL 8.0.28
- APIJSON: 4.9.1
问题描述
子查询中没办法引用父查询的字段
数据库结构和数据如下:
apijson如下:
{
"[]": {
"Lrx_student": {
"sid}{@": {
"from": "Lrx_score",
"Lrx_score": {
"@column": "sid;grade",
"sid@": "[]/Lrx_student/sid", //没办法引用
"grade>":"90"
}
}
}
},
"@schema": "lrx"
}
结果如下:

错误信息
目前不支持在子查询中引用赋值,可以反过来写,EXISTS 改为 IN,里面就不需要引用赋值(外键关联)键值对了
{
"[]": {
"Lrx_student": {
"sid{}@": {
"from": "Lrx_score",
"Lrx_score": {
"@column": "sid;grade",
"grade>":"90"
}
}
}
},
"@schema": "lrx"
}
https://github.com/Tencent/APIJSON/blob/master/Document.md#3.2

打算后续支持在子查询中引用赋值,可以在建议收集箱 issue 提个建议看看多少人点赞(需要这个功能) https://github.com/Tencent/APIJSON/issues/37