View Single Post
Old 01-11-2008, 10:12 PM   #6 (permalink)
webosb
The Contributor
 
webosb's Avatar
 
Join Date: Nov 2007
Posts: 41
Thanks: 24
webosb is on a distinguished road
Default

Quote:
Originally Posted by Salathe View Post
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
This is exactly what I wanted. I'm still new to GROUP BY. Thanks alot Salathe!
__________________
"Things you can get access to, you should never memorize." -Albert Einstein
"They that can give up essential liberty to obtain a little temporary safety deserve neither liberty nor safety." -Benjamin Franklin
webosb is offline  
Reply With Quote