<p>Given a table (mytable) containing a numeric field (mynum), how would one go about writing an SQL query which summarizes the table's data based on ranges of values in that field rather than each distinct value?</p>

<p>For the sake of a more concrete example, let's make it intervals of 3 and just "summarize" with a count(*), such that the results tell the number of rows where mynum is 0-2.99, the number of rows where it's 3-5.99, where it's 6-8.99, etc.</p>

The idea is to compute some function of the field that has constant value within each group you want:
```
```
select count(*), round(mynum/3.0) foo from mytable group by foo;
```
```