SELECT IDConto, SUM(CAST(((quantita*prezzo) - (quantita*prezzo)*sconto/100.00)) AS decimal(10,2)) AS tot FROM prodotti_venduti WHERE id_differita=4433 GROUP BY IDConto
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AS decimal(10,2)) AS tot FROM prodotti_venduti WHERE id_differita=4433 GROUP B' at line 1