Ma hai provato con un

select sum(prodotto * quantita) as totale from ....

?