簡體   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