grouping by email domain mysql

Solutions on MaxInterview for grouping by email domain mysql by the best coders in the world

showing results for - "grouping by email domain mysql"
Rashad
13 Mar 2020
1SELECT substring_index(email, '@', -1) domain, COUNT(*) email_count
2FROM table
3GROUP BY substring_index(email, '@', -1)
4
5-- If you want to sort as well:
6ORDER BY email_count DESC, domain;
similar questions
queries leading to this page
grouping by email domain mysql