本文介绍了我想要求值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有以下查询,我想要总和E.Value(C.Idclient,Con.Code作为国家代码明智的其他选择字段是个人)。怎么办?



查询:

I Have The Following Query, I Want To Sum Of E.Value (C.Idclient,Con.Code As "Countrycode" Wise Other Selection Field Is Individual). How Can Do This?

Query:

SELECT C.IDCLIENT, D.DOCNO, E.NO, D.OPDATE, E.VALUEDATE, E.DEBITENTCODE, E.DEBITACCOUNT, E.CREDITACCOUNT, E.VALUE, E.SHORTREMARK, ATM.PAN, ATM.TERM,
 ATM.DEVICE,    ATM.ISSCODE, ATM.FICODE, ATM.ENTTYPE, ATM.CURRENCY, ATM.TERMLOCATION, CON.NAME, TP.CODE,CON.CODE AS "CountryCode",TP.NAME AS "CardTypeName"
  FROM (TDOCUMENT D JOIN TENTRY E ON D.DOCNO = E.DOCNO AND D.BRANCH = E.BRANCH JOIN TACCOUNT A ON A.BRANCH=E.BRANCH AND A.ACCOUNTNO=E.CREDITACCOUNT
  JOIN TATMEXT ATM ON D.DOCNO = ATM.DOCNO AND D.BRANCH = ATM.BRANCH JOIN A4M.TREFERENCECOUNTRY CON ON  ATM.ACQCOUNTRY = CON.CODE AND CON.BRANCH = ATM.BRANCH
  JOIN TCARD C ON C.BRANCH = ATM.BRANCH AND ATM.PAN = C.PAN
  JOIN A4M.TREFERENCECARDPRODUCT TP ON ATM.PAN LIKE TP.PREFIX||'%' AND CON.BRANCH = TP.BRANCH)
  WHERE D.BRANCH = 7060 AND ATM.ACQCOUNTRY  <> 50
  AND TP.CODE IN ( 21,28,29,30,41,42,102,103,104,105) AND D.NEWDOCNO IS NULL
  AND ATM.ISSCODE NOT IN (401,513,527) AND ATM.FICODE NOT IN (401,513,527) AND ATM.ENTTYPE <> 'R' AND ATM.ENTCODE = 10 AND ATM.FICODE <> 33
  AND D.OPDATE BETWEEN '06-OCT-2015' AND '07-OCT-2015' AND E.DEBITENTCODE = 45 AND E.NO = 1 ORDER BY CON.NAME,D.OPDATE,D.DOCNO,E.NO

推荐答案



这篇关于我想要求值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-23 01:46