"SELECT SUM(prezzo) AS totale, prodotto FROM `tabella` GROUP BY prodotto"