0
The Consultation:
Select ITEMNFS.Recnum, ITEMNFS.ITEM, sum(ITEMNFS.VL_TOTAL), sum(ITEMNFS.QTDE_FATUR), ITEM.PER_IPI
from ITEMNFS
inner join ITEM on ITEMNFS.ITEM = ITEM.ITEM inner join NFS on ((ITEMNFS.NRO_NFS = NFS.NRO_NFS) and (ITEMNFS.SERIE = NFS.SERIE))
where (NFS.DT_EMISSAO between '2017-12-01' and '2018-02-20')
group by ITEMNFS.ITEM
The error is as follows:
SQL0119N An expression started with "PER_IPI" specified in a SELECT or HAVING clause not specified in GROUP BY clause or is in a SELECT, HAVING or ORDER BY clause with a function of column without a specified GROUP BY clause. SQLSTATE=42803
Okay, it works, but not exactly the way I want it. I would need to group and sum them with all lines that have ITEMNFS.ITEM equal I don’t know if I understand
– Luvazera
For that you would need to remove the other columns (ITEMNFS.Recnum and ITEM.) so much of
select
how much ofgroup by
– rLinhares