Pentaho Report Designer在查询中出错

时间:2014-01-03 07:28:50

标签: mysql sql pentaho pentaho-report-designer

我正在尝试在Pentaho Report Designer中创建我的第一份报告。我创建了一个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 

但是,当我保存查询时,它会更改为:

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

我的查询中是否有任何问题导致其更改?该语法在其他查询分析器中运行良好......

1 个答案:

答案 0 :(得分:1)

您的查询应该有效,但似乎Pentaho在解析它时遇到了问题。

您可以尝试使用

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

它提供与查询相同的结果但没有子查询(希望它会让Pentaho满意)