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)
 Duplicate Records

Author  Topic 

oahu9872
Posting Yak Master

112 Posts

Posted - 2006-11-06 : 16:22:16
I have a table with about 2.8 million records and i suspect there may be a few thousand duplicates. there's too many records to do a simple group by, so is there a better way to do this. this is what i tried but the syntax was rejected...

SELECT TDN FROM ALL_TN_STAT
WHERE COUNT(TDN) > 1

So I need to find in table ALL_TN_STAT how many records have duplicate TDN fields.

Thanks

stephe40
Posting Yak Master

218 Posts

Posted - 2006-11-06 : 16:32:07
[code]
SELECT TDN, count(*)
FROM ALL_TN_STAT
group by TDN
having count(*) > 1
[/code]

- Eric
Go to Top of Page

oahu9872
Posting Yak Master

112 Posts

Posted - 2006-11-06 : 16:42:19
great, thanks
Go to Top of Page
   

- Advertisement -