|
版本: |
BeX5V3.5 |
小版本号: |
|
|
|
数据库: |
MySQL |
服务器操作系统: |
Windows |
应用服务器: |
Tomcat |
客户端操作系统: |
Windows 8 |
浏览器: |
Chrome |
|
|
KSQL代码:- select FI_articleInfo,FI_articleInfo.fArticleName as fArticleName,customSub3.fInboundSum,customSub3.fOutboundSum
- from FI_articleInfo FI_articleInfo
- join ( select (SQL.IFNULL(customSub1.fArticleID, customSub2.fArticleID)) as fArticleID,(customSub1.fQuantity) as fInboundSum,(customSub2.fQuantity) as fOutboundSum from (select FI_articleMoveDetail.fArticleID as fArticleID, (SUM(FI_articleMoveDetail.fQuantity)) as fQuantity from FI_articleMove FI_articleMove
- join FI_articleMoveDetail FI_articleMoveDetail on FI_articleMove = FI_articleMoveDetail.fMainID
- where FI_articleMove.fType = '入库单'
- group by FI_articleMoveDetail.fArticleID) customSub1 optional
- join (select FI_articleMoveDetail.fArticleID as fArticleID, (SUM(FI_articleMoveDetail.fQuantity)) as fQuantity from FI_articleMove FI_articleMove
- join FI_articleMoveDetail FI_articleMoveDetail on FI_articleMove = FI_articleMoveDetail.fMainID where FI_articleMove.fType = '出库单'
- group by FI_articleMoveDetail.fArticleID) customSub2 on customSub1.fArticleID = customSub2.fArticleID ) customSub3 on FI_articleInfo=customSub3.fArticleID
复制代码
多层嵌套查询,测试也通过,保存以后再打开,报错代码错误,对比发现子语句的小括号被删掉了:
|
-
保存前,测试通过
-
保存后,再打开,画线处的括号没有了,造成无法语句无法执行
-
报错页面
|