I have the following query:
Select
msi.segment1 codigo,
msi.description descricao,
pcn1.quantidade Qtde_Romaneio,
nvl(SUM(pcn2.quantidade),0) Qtde_Coleta,
(nvl(sum(pcn2.quantidade),0) - pcn1.quantidade) Diferenca,
nvl(pcn2.ip,0) Coletor,
nvl(PCN2.USUARIO,0) Usuario,
nvl(pcn2.reconferencia,'X') Reconferencia,
to_char(PCN2.data, 'DD/mm/yyyy hh24:mi:ss') Data
from
PCN_ROMANEIO_RESUMO pcn1,
PCN_ROMANEIO_COLETA pcn2,
MTL_SYSTEM_ITEMS msi,
MTL_CROSS_REFERENCES_V mrv
Where
pcn1.codigo = mrv.cross_reference
and msi.inventory_item_id = mrv.inventory_item_id(+)
and msi.organization_id = 104
and mrv.CROSS_REFERENCE_TYPE(+) = 'DUN14'
and pcn1.codigo = pcn2.codigo(+)
and pcn1.romaneio = pcn2.romaneio(+)
and pcn1.romaneio = ('$romaneio')
group by
msi.segment1,
msi.description,
nvl(pcn2.ip,0),
PCN2.USUARIO,
nvl(pcn2.reconferencia,'X'),
pcn1.quantidade,
to_char(PCN2.data, 'DD/mm/yyyy hh24:mi:ss')
order by 1
It returns me to the situation below:
Youwouldneedtodisplaythesumofthequantitiesofthesameiteminsomeway,regardlessofthedate.IfItakethetimefromthePCN2.data
fielditworksnormally,asitshould.
Isthereawayto"ignore" the PCN2.data
field at group by time, but display it in the query?