I have a simple BIRDCOUNT table below showing how many birds were counted on any given day:
+----------+
| NUMBIRDS |
+----------+
| 123 |
| 573 |
| 3 |
| 234 |
+----------+
I would like to create a frequency distribution graph showing how many times the number of birds was counted. Therefore, I need MySQL to create something like:
+------------+-------------+
| BIRD_COUNT | TIMES_SEEN |
+------------+-------------+
| 0-99 | 17 |
| 100-299 | 23 |
| 200-399 | 12 |
| 300-499 | 122 |
| 400-599 | 3 |
+------------+-------------+
If the bird counting ranges were corrected, that would be easy. However, I never know min / max how many birds were visible. So I need a select statement that:
- Creates a conclusion similar to the above, always creating 10 ranges of samples.
- (more advanced) Generates a conclusion similar to the above, always creating N counting ranges.
I don't know if # 2 is possible in one choice, but can anyone solve # 1?
source
share