SELECT DAYOFMONTH(localdatetime) as giorno, SUM(pm)/4000 as potenza, tariffa as fascia FROM samples WHERE LocalDateTime>=20090720000000 and LocalDateTime<20090727000000
GROUP BY DAYOFMONTH(localdatetime) ,tariffa
ORDER BY giorno.
SELECT DAYOFMONTH(localdatetime) as giorno, SUM(pm)/4000 as potenza, tariffa as fascia FROM samples WHERE LocalDateTime>=20090720000000 and LocalDateTime<20090727000000
GROUP BY DAYOFMONTH(localdatetime) ,tariffa
ORDER BY giorno.
Fidatevi del dottor Auz!
http://dottorauz.blogspot.com