E no .... siamo il max del min..... questo lo dovresti sapere da te....
metti un campo mese nel select.... e usalo pure nel group by....
codice:
SELECT table3.nomecampo,
FROM_UNIXTIME(miadata, '%m') as mese,
SUM(quantita) AS totale,
SUM(opzione1*quantita) AS opzione1,
SUM(opzione2*quantita) AS opzione2,
SUM(opzione3*quantita) AS opzione3,
SUM((opzion1*quantita)+(opzione2*quantita)+(opzione3*quantita)) AS totale_prezzo
FROM table1 LEFT JOIN table3 USING (productid)
LEFT JOIN table2 USING (fieldid)
WHERE table2.field='product_group' AND FROM_UNIXTIME(miadata, '%Y') = $Year
GROUP BY table3.nomecampo, mese;