|
| View previous topic :: View next topic |
| Author |
Message |
vm

Joined: 27 Dec 2003 Posts: 50
|
Posted: Fri Oct 19, 2007 7:41 pm Post subject: Looking for duplicates |
|
|
Found this here. Worked great on my test db. | Quote: | select email, count(email) as numoccurrences from users
group by email having (count(email)>1) |
I need to figure how to check more than one field of data. |
|
| Back to top |
|
 |
vm

Joined: 27 Dec 2003 Posts: 50
|
Posted: Fri Oct 19, 2007 8:10 pm Post subject: |
|
|
I found out how to check for two columns being duplicated: | Code: | select TheName, email,
count(TheName) as NumOccurName,
count (email) as NumOccurEmail from users
group by TheName, email
having (count(TheName)>1)
and (count(email)>1) |
For what I need - 6 rows being duplicated is the limit. |
|
| Back to top |
|
 |
vm

Joined: 27 Dec 2003 Posts: 50
|
Posted: Fri Oct 19, 2007 8:57 pm Post subject: |
|
|
For 6 fields: | Code: | Select TheDate, TheTime, TheSID, TheIP, TheDomain, TheNetwork,
count(TheDate) as NumOccurDate,
count(TheTime) as NumOccurTime,
count(TheSID) as NumOccurSID,
count(TheIP) as NumOccurIP,
count(TheDomain) as NumOccurDomain,
count(TheNetwork) as NumOccurNetwork from Users1
group by TheDate, TheTime, TheSID, TheIP, TheDomain, TheNetwork
having
(count(TheDate)>1) and
(count(TheTime)>1) and
(count(TheSID)>1) and
(count(TheIP)>1) and
(count(TheDomain)>1) and
(count(TheNetwork)>1) |
|
|
| Back to top |
|
 |
vm

Joined: 27 Dec 2003 Posts: 50
|
Posted: Fri Oct 19, 2007 10:46 pm Post subject: |
|
|
| All of the above is unneccessary. |
|
| Back to top |
|
 |
|
|
|
 |