Created
September 1, 2015 03:43
-
-
Save aaronbuchanan/ddcf362b4492cc61503f to your computer and use it in GitHub Desktop.
MYSQL statement to parse the domain of an email and show the most common domains
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
select count(*) as occurrances, substring_index(email, "@", -1) as domain | |
from users | |
group by substring_index(email, "@", -1) | |
ORDER by occurrances DESC | |
limit 100; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment