Skip to content

Instantly share code, notes, and snippets.

@martijngastkemper
Created November 3, 2014 16:35
Show Gist options
  • Save martijngastkemper/95500c82bdb007081fff to your computer and use it in GitHub Desktop.
Save martijngastkemper/95500c82bdb007081fff to your computer and use it in GitHub Desktop.
A mysql query to group the domains in your list of e-mail addresses
SELECT
(substr( email, instr( email, '@') + 1)) as domain,
count(*) as total
FROM relations
GROUP BY domain
ORDER BY total DESC;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment