Skip to content

Instantly share code, notes, and snippets.

@ivan1911
Created July 5, 2013 11:43
Show Gist options
  • Save ivan1911/5934000 to your computer and use it in GitHub Desktop.
Save ivan1911/5934000 to your computer and use it in GitHub Desktop.
User Email Domains popularity MySQL
SELECT SUBSTRING_INDEX(Email, '@', -1) as Domain, count(*) as Total
FROM Users
GROUP BY Domain
ORDER BY Total DESC
LIMIT 15;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment