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;
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;
0 Comments