Answers for "grouping by email domain mysql"

SQL
0

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;
Posted by: Guest on May-27-2021

Code answers related to "SQL"

Browse Popular Code Answers by Language