I have the following query:
SELECT DISTINCT
CTRL_CARGA_PED_VENDA.CtrlCargaNum, ITEM_PED_VENDA.PedVendaNum,
PRODUTO.ProdCodEstr, PRODUTO.ProdNome, Sum(ITEM_PED_VENDA.ItPedVendaQtd) AS
QtdItem FROM ITEM_PED_VENDA, CTRL_CARGA_PED_VENDA, PRODUTO
WHERE CTRL_CARGA_PED_VENDA.PedVendaNum = ITEM_PED_VENDA.PedVendaNum
AND ITEM_PED_VENDA.EmpCod = CTRL_CARGA_PED_VENDA.EmpCod
AND ITEM_PED_VENDA.ProdCodEstr = PRODUTO.ProdCodEstr
AND CTRL_CARGA_PED_VENDA.EmpCod = '01'
AND CTRL_CARGA_PED_VENDA.CtrlCargaNum = '0000038'
GROUP BY
CTRL_CARGA_PED_VENDA.CtrlCargaNum,PRODUTO.ProdNome, ITEM_PED_VENDA.PedVendaNum, PRODUTO.ProdCodEstr, ITEM_PED_VENDA.ItPedVendaQtd
It works perfectly, how do I make it add products that have equal values and leave only a single name?