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 )
No comments:
Post a Comment
Home
Subscribe to:
Post Comments (Atom)
Subscribe To Code Project
Posts
Atom
Posts
Comments
Atom
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...
No comments:
Post a Comment