繁体   English   中英

在 informatica 目标平面文件的输出底部添加总计行

[英]Add a total row at the bottom of the output in informatica target flat file

我正在寻找 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

您也可以在 informatica 中尝试此操作。

  1. 添加一个聚合器来计算计数,记录总数。
  2. 使用 UNION 转换将其与主流联合。 并确保将其添加到适当的字段和主要数据下方。 流程应该是这样的——
SQ ->... -> EXP ------>| 
             |         UNI -> TGT
             |-> AGG-->|

最简单的方法可能是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

暂无
暂无

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

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