0
I have two tables BMV_PEDIDO
and BMV_PEDIDOITEM
and would like the total sum of the value of the orders made on a given date. I currently make this request per request, ie, I replicate this code 70x.
I would like my query to return all.
Follows the script current:
SELECT p.ST_FRETE, SUM(i.NR_QTDE * i.VL_UNITARIO * i.NR_TAXACONVERSAO)
FROM BMV_PEDIDOITEM i
INNER JOIN BMV_PEDIDO p ON p.ID_PEDIDO = i.ID_PEDIDO
WHERE p.ID_PEDIDO IN (45752)
GROUP BY p.ST_FRETE
p.ID_PEDIDO in( 45752) ? is when you have 1000 requests will repeat 1000 times the same code?
– Harry
@Juniortorres: In addition to the "total sum of the order value made on a given date", do you also need the date requests to be listed? Or only the total value, without lines of detail?
– José Diz