I try this query:
select t.clndhf, t.ciusmd, t.nmismd, SUM(Quantity) as Num_Products
from
(
select clndhf, ciusmd, nmismd, sum(qtfdhf) as Quantity
from swapfilio.EESWPLFD join swapfilio.EESWPLFH
on SOCSLD = SOCSLH
and CODSLD = CODSLH
join swapfilio.gesmd
on SOCSLD = socsmd
and NIISLD =...
the last column is what i want to calculate.
Its the sum (QTD) of the article (ciusmd)
Example:
This article 6191569 (ciusmd) as this quantatys (QTD) 2 +2 +1 = 5 (i want the sum 5 in this example in all 6191569 lines)
and the article 5179627 as 160 + 92 + 1 + 11 (QTD) = 264 (i want the sum 264...
this is my query:
select NFREFC, nmff01, ciusmd, nmismd, sum(QRCEGP) as qtd
from swapfilio.gcffc join swapfilio.gcffp
on SOCEFC = SOCEFP
and NFREFC = FRNEFP
and NRFEFC = NRFEFP
join swapfilio.gcfgp
on SOCEGP = SOCEFP
and ARMEGP = ARMEFP
and AGREGP = AGREFP
and NGREGP = NGREFP
and NLNEGP =...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.