Is there a way to specify bin sizes in MySQL? Right now, I am trying the following SQL query:
select total, count(total) from faults GROUP BY total;
<
Mike DelGaudio's answer is the way I do it, but with a slight change:
select floor(mycol/10)*10 as bin_floor, count(*)
from mytable
group by 1
order by 1
The advantage? You can make the bins as large or as small as you want. Bins of size 100? floor(mycol/100)*100. Bins of size 5? floor(mycol/5)*5.
Bernardo.