http://www.petefreitag.com/item/169.cfm
SELECT email,
COUNT(email) AS NumOccurrences
FROM users
GROUP BY email
HAVING ( COUNT(email) > 1 )
SELECT email
FROM users
GROUP BY email
HAVING ( COUNT(email) = 1 )
31 May 2011
It turns out these code was pretty awesome when I want to make a dynamic drop down selection
I can make it display unique value and sorted by most use at the top
No comments:
Post a Comment