简体   繁体   English

查询中的Pentaho Report Designer错误

[英]Pentaho Report Designer error in query

I am trying to create my first report in Pentaho Report Designer. 我正在尝试在Pentaho Report Designer中创建我的第一个报告。 I have created a JDBC Data Source and added a query: 我创建了一个JDBC数据源并添加了一个查询:

SELECT a.* 
FROM   (SELECT Sum(loan_receivable_detail.interest) AS interest, 
               loan_account_opening_id 
        FROM   loan_receivable_detail 
        GROUP  BY loan_account_opening_id) AS a 

However when I save the query, it changes to: 但是,当我保存查询时,它更改为:

SELECT
     a.*,
     sum(loan_receivable_detail.interest) AS interest,
     loan_account_opening_id AS interest
FROM
     `loan_receivable_detail`
GROUP BY
     loan_account_opening_id,
     as,
     a

Is there any problem in my query causing it to change like this? 我的查询中是否有任何问题导致其像这样更改? The syntax works well in other query analyzers... 该语法在其他查询分析器中效果很好...

Your query should be valid, but it seems like Pentaho is having problems parsing it. 您的查询应该是有效的,但是Pentaho似乎在解析它时遇到了问题。

You could try to use 您可以尝试使用

SELECT SUM(loan_receivable_detail.interest) AS interest, 
               loan_account_opening_id 
        FROM   loan_receivable_detail 
        GROUP  BY loan_account_opening_id

Which gives the same results as your query but without the subquery (Hopefully it will make Pentaho happy ) 它提供与您的查询相同的结果,但没有子查询(希望它将使Pentaho满意)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM