【问题标题】:Add a total row at the bottom of the output in informatica target flat file在 informatica 目标平面文件的输出底部添加总行
【发布时间】:2020-11-17 17:53:19
【问题描述】:
我正在寻找 informatica powercenter 中的解决方案,它可以让我在输出的底部添加一个总行。我目前正在使用 Oracle Sql 格式和 Sql 开发人员应用程序中的代码
电流输出
StudentName History Math Science
John Doe. 10. 20. 30
John Watts. 30. 50. 20
想要的输出
StudentName History Math Science
John Doe. 10. 20. 30
John Watts. 30. 50. 20
Total. 40. 70. 50
【问题讨论】:
标签:
sql
oracle-sqldeveloper
informatica-powercenter
【解决方案1】:
您也可以在 informatica 中尝试此操作。
- 添加聚合器来计算计数、记录总数。
- 使用 UNION 转换将其与主流合并。并确保将其添加到适当的字段并在主要数据下方。
流程应该是这样的 -
SQ ->... -> EXP ------>|
| UNI -> TGT
|-> AGG-->|
【解决方案2】:
最简单的方法大概是union all。如果你真的想要最后一行,那么:
select tt.*
from ((select studentname, history, math, science
from t
) union all
(select 'Total', sum(history), sum(math), sum(science)
from t
)
) tt
order by (case when studentname = 'Total' then 1 else 2 end) desc,
studentname