Código SQL:
Ver originalSELECT SUM(valorunitario), producto FROM(
SELECT [dbo].[F_MonedaMVForm]('FAC','FS','7332',mvtrade.idmvtrade) AS ValorUnitario,mvtrade.PRODUCTO,mvtrade.NOMBRE,mvtr ade.UNDVENTA, 0 AS 'ordimp'
FROM MVTrade INNER JOIN MTMERCIA ON MVTrade.PRODUCTO = MTMERCIA.CODIGO
WHERE NOT MVTrade.PRODUCTO IN ('2600','2600A') AND
MVTrade.Origen ='FAC' AND
MVTrade.TipoDcto='FS' AND
MVTrade.NroDcto='7332'
UNION
SELECT SUM(MVTrade.VALORUNIT) AS ValorUnitario,mvtrade.PRODUCTO,mvtrade.NOMBRE,mvtr ade.UNDVENTA, 0 AS 'ordimp'
FROM mvtrade JOIN MTMERCIA ON MVTrade.PRODUCTO = MTMERCIA.CODIGO
WHERE MVTrade.PRODUCTO IN ('2600','2600A') AND
MVTrade.ORIGEN = 'FAC' AND
MVTrade.TIPODCTO = 'FS' AND
MVTrade.NroDcto='7332'
GROUP BY PRODUCTO, NOMBRE, UNDVENTA
) AS t1 GROUP BY producto
algo asi