you are here: codestackercodes [RSS]count domain users using sql

count domain users using sql

from: http://www.mendable.com/sql-trick-where-are-your-users-from/

SELECT COUNT(*) AS Total, SUBSTRING_INDEX(email, '@', -1) AS Domain FROM users 
GROUP BY SUBSTRING_INDEX(email, '@', -1) ORDER BY COUNT(*) DESC LIMIT 10;

Comments