0
I am using the same query:
Select
TAB.DESCRPROD,
PRO.DT_INC,
PRO.QTD_FALT,
PRO.OBS,
PRO.CODPROD,
RETIRA,
PRAZO,
PREV_ENTREGA,
NRO_OF,
NRO_OP,
MODELO,
SEPARACAO,
MONTAGEM,
GAB,
PROD_CLIENTE,
STATUS,
ORIGEM,
SETOR,
(CASE WHEN ORIGEM = 'F' THEN 'FINALIZADO'
when ORIGEM = 'P' THEN 'PRODUÇÃO'
WHEN ORIGEM = 'A'THEN 'ALMOXARIFADO'
ELSE ORIGEM END) AS ORIGEM2
,
(CASE WHEN GAB = '1' THEN 'N/A'
when GAB = '2' THEN 'FAL.'
WHEN GAB = '3' THEN 'OK'
ELSE GAB END) AS GAB2
,
(CASE WHEN PROD_CLIENTE = '1' THEN 'N/A'
when PROD_CLIENTE = '2' THEN 'FAL.'
WHEN PROD_CLIENTE = '3' THEN 'OK'
ELSE PROD_CLIENTE END) AS EMB
from
AD_FALTAPECAS PEC
INNER JOIN AD_PRODUTOS PRO ON
PEC.SEQUENCIAL=PRO.SEQUENCIAL
INNER JOIN TGFPRO TAB ON
TAB.CODPROD=PRO.CODPROD
where
SETOR = $P{P_SETOR} and
ORIGEM != 'F' AND
PRO.STATUS_ENT = 'P'
order by PRAZO
I’d like to add a Group by PRO.CODPROD
.
But when I do I get the error message:
Invalid 'TGFPRO.DESCRPROD' column in the selection list because it is not is contained in an aggregation function or in the GROUP BY clause.
Please help me out.
It seems to be only about SQL and Voce put Javascript and Java tags, what this has to be?
– Cmte Cardeal
So that the "group by" ?
– Motta
So in my report I’m ordering by Productive Lot and within that lot I have several equipment to produce. Many times a piece or other has some missing piece. The by order is to group the amount of repeated parts in a single batch.
– Marco Moleti
Sorry, I did not take any course and do not know language name, I just was learning by trial and error. I did not know it was only SQL.
– Marco Moleti