01-11-2008, 08:50 PM
|
#2 (permalink)
|
|
The Addict
Join Date: Jan 2008
Location: USA
Posts: 218
Thanks: 16
|
Um, that's what we call obfuscated code. That's really a wacky query, no offense meant. How about :
sql Code:
SELECT DISTINCT SUBSTRING(email, LOCATE('@', email)+1) AS domain FROM users ORDER BY domain
I'm not particularly good at SQL yet, so I'm not sure how you'd count users per domain. It could be group-by or a subquery as a variable name.
__________________
Programmers are in a race with the Universe to create bigger and better idiot-proof programs, while the Universe is trying to create bigger and better idiots. So far the Universe is winning. - Rich Cook
|
|
|
|