Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
MYSQL statement to parse the domain of an email and show the most common domains
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