How to perform the sum of values that I have multiplied?

1

I performed an operation that multiplies the quantity of values by the unit value of each one, obtaining the total value per product. How could you add up the total values of all products? I tried with a Sum inside a Sum ...

EDIT1: I tried to use RollUp but I ended up breaking the 100mb limit

    
asked by anonymous 20.04.2017 / 19:39

1 answer

0

I think it's something like:

select cod_produto , sum(valor_unitario * quantidade) valor_total
from   vendas
group by cod_produto 
    
20.04.2017 / 21:22