Postgresql 如何在pentaho报表设计器PRD 5.3中创建动态sql查询?
我正在使用petaho报告设计器 我的主要问题是Postgresql 如何在pentaho报表设计器PRD 5.3中创建动态sql查询?,postgresql,pentaho,pentaho-cde,pentaho-design-studio,pentaho-ctools,Postgresql,Pentaho,Pentaho Cde,Pentaho Design Studio,Pentaho Ctools,我正在使用petaho报告设计器 我的主要问题是 select create_date , sum(product_uos_qty) from sale_order_line group by create_date SELECT column_name FROM information_schema.columns WHERE table_schema='public' AND table_name='sale_order_line' AND (column_name = 'pro
select create_date , sum(product_uos_qty) from sale_order_line group
by create_date
SELECT column_name
FROM information_schema.columns
WHERE table_schema='public'
AND table_name='sale_order_line'
AND (column_name = 'product_uos_qty' OR column_name ='price_unit')
product_uos_qty
price_unit
它运行正常
子查询是
select create_date , sum(product_uos_qty) from sale_order_line group
by create_date
SELECT column_name
FROM information_schema.columns
WHERE table_schema='public'
AND table_name='sale_order_line'
AND (column_name = 'product_uos_qty' OR column_name ='price_unit')
product_uos_qty
price_unit
此查询的输出为
select create_date , sum(product_uos_qty) from sale_order_line group
by create_date
SELECT column_name
FROM information_schema.columns
WHERE table_schema='public'
AND table_name='sale_order_line'
AND (column_name = 'product_uos_qty' OR column_name ='price_unit')
product_uos_qty
price_unit
我创建了一个参数选择
并将主查询转换为
select create_date , sum(${select}) from sale_order_line group by create_date
但它没有运行,因此会出现以下错误
错误:查询“main”未成功执行。给出的理由
是:
'org.pentaho.reporting.engine.classic.core.ReportDataFactoryException:
查询失败:从中选择创建日期和(${select})
销售\订单\按创建\日期的行组'
告诉我主要问题是什么以及我如何解决它您需要在子选择中同时使用
产品数量、价格单位
列还是什么?您需要两个,但在选择基础上一次需要一个注意:此是否选择创建日期、总和(产品数量)、总和(价格单位)按创建日期从销售订单行组中选择列名称方法不能使用?我认为它可以同时访问产品数量和价格单位。需要说明的功能:为什么要使用此从信息模式中选择列名称。表模式为public和表名称为sale订单行的列以及(列\名称='产品\计量单位\数量'或列\名称='价格\单位')
?,您可以直接给列名称,对吗?