Ad Code

MySQL Query to Count Unique Domains from Email Address field

 You would have to do something like this:

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;

Post a Comment

0 Comments