Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 finding duplicates values

Author  Topic 

cr8nk
Yak Posting Veteran

77 Posts

Posted - 2001-11-30 : 13:19:37
Hello,

I need to remove about one million duplicate rows from a 11 million row table and I want to determine the exact count of duplicates that I have and remove them from the table.

Here is the table structure.

ADACCT varchar 15
ADFCDE varchar 10
ADCCDE varchar 10
ADACDE varchar 10
ADATYP varchar 2
ADCUSR varchar 50
ADADAT numeric 9
ADATIM numeric 9
ADTDUE decimal 9
ADECDE varchar 2
ReportDate smalldatetime 4

This is my query to find out the duplicates in the table.


select count(*)

from dbo.AccountActivity

group by ADACCT,ADFCDE,ADCCDE,ADATYP,ADCUSR,ADADAT,
ADATIM,ADTDUE,ADECDE,ReportDate

HAVING count(*) > 1


Is there a better way to find out all the duplicate rows in your table?



AjarnMark
SQL Slashing Gunting Master

3246 Posts

Posted - 2001-11-30 : 15:49:35
In the SQLTeam FAQ, there's a link to this article.

-------------------
It's a SQL thing...
Go to Top of Page
   

- Advertisement -