Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SQL

grouping by email domain mysql

SELECT substring_index(email, '@', -1) domain, COUNT(*) email_count
FROM table
GROUP BY substring_index(email, '@', -1)

-- If you want to sort as well:
ORDER BY email_count DESC, domain;
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #grouping #email #domain #mysql
ADD COMMENT
Topic
Name
8+5 =