Home > How to ... ?, MySQL, Quick Tips > MySQL How to select domain name from email address ?

MySQL How to select domain name from email address ?

SELECT 
   COUNT(*) as cnt, SUBSTR(SUBSTR(Email, INSTR(Email, '@'), INSTR(Email, '.')), 2) as domain 
FROM 
   Users 
GROUP BY domain 
ORDER BY cnt DESC
Categories: How to ... ?, MySQL, Quick Tips Tags:
Вижте всички статии от
Technology lover
Този автор е написал 156 статии