Skip to content

Instantly share code, notes, and snippets.

@muffinista
Created September 24, 2014 12:23
Show Gist options
  • Save muffinista/0d2c21a6d0c37a7402ab to your computer and use it in GitHub Desktop.
Save muffinista/0d2c21a6d0c37a7402ab to your computer and use it in GitHub Desktop.
1st letter of us place names
mysql> select substr(name, 1, 1) as alpha, count(id) from places group by alpha;
+-------+-----------+
| alpha | count(id) |
+-------+-----------+
| 1 | 7 |
| 2 | 4 |
| 4 | 1 |
| 6 | 1 |
| 9 | 1 |
| A | 7479 |
| B | 16739 |
| C | 18604 |
| D | 6929 |
| E | 7015 |
| F | 7873 |
| G | 8653 |
| H | 12170 |
| I | 2015 |
| J | 2690 |
| K | 4268 |
| L | 11308 |
| M | 14967 |
| N | 6413 |
| O | 5424 |
| P | 12044 |
| Q | 624 |
| R | 9719 |
| S | 19708 |
| T | 7318 |
| U | 1254 |
| V | 2957 |
| W | 12950 |
| X | 21 |
| Y | 814 |
| Z | 365 |
| ` | 2 |
+-------+-----------+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment