查询中的Pentaho Report Designer错误 [英] Pentaho Report Designer error in query

查看:97
本文介绍了查询中的Pentaho Report Designer错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试在Pentaho Report Designer中创建我的第一个报告.我已经创建了一个JDBC数据源并添加了一个查询:

I am trying to create my first report in Pentaho Report Designer. I have created a JDBC Data Source and added a query:

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...

推荐答案

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

Your query should be valid, but it seems like Pentaho is having problems parsing it.

您可以尝试使用

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

给出的结果与您的查询相同,但没有子查询(希望它将使Pentaho满意)

Which gives the same results as your query but without the subquery (Hopefully it will make Pentaho happy )

这篇关于查询中的Pentaho Report Designer错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆