View Single Post
Old 01-11-2008, 09:38 PM   #5 (permalink)
Salathe
Moderateur
RegEx Guru PHP Guru Top Contributor Advanced Programmer 
 
Salathe's Avatar
 
Join Date: Apr 2007
Posts: 1,393
Thanks: 5
Salathe is on a distinguished road
Default

My version of MySQL (5.0.27) allows me to make the following query without any complaints:

SQL Code:
SELECT DISTINCT
    SUBSTRING(email, LOCATE('@', email) + 1) AS domain,
    COUNT(*) AS domain_count
FROM
    users
GROUP BY
    domain
ORDER BY
    domain
Salathe is offline  
Reply With Quote
The Following User Says Thank You to Salathe For This Useful Post:
webosb (01-11-2008)