01-11-2008, 10:12 PM
|
#6 (permalink)
|
|
The Contributor
Join Date: Nov 2007
Posts: 41
Thanks: 24
|
Quote:
Originally Posted by Salathe
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
|
|
|
|