SELECT type,count(`type`) FROM `statistics` WHERE date(statistics.datetime) >= date('2012-07-01') AND date(statistics.datetime) <= date('2012-07-31') group by type