skip to main
|
skip to sidebar
code project
Finding Duplicates with SQL
SELECT email,
COUNT(email) AS NumOccurrences
FROM users
GROUP BY email
HAVING ( COUNT(email) > 1 )
You could also use this technique to find rows that occur exactly once:
SELECT email
FROM users
GROUP BY email
HAVING ( COUNT(email) = 1 )
Home
Subscribe to:
Posts (Atom)
Subscribe To Code Project
Posts
Atom
Posts
All Comments
Atom
All Comments
Followers
IT Jobs and Recruitment Info
Loading...
The Code Project Latest Articles
Loading...
Blog Archive
▼
2009
(1)
▼
April
(1)
Finding Duplicates with SQL
About Me
Pankaj Deharia
View my complete profile
MOBILE INFORMATION
Loading...