Here's some great code for determining dupes in a column.  I use this when I want to assign a unique primary key after the data is loaded and I want to see the offenders.

SQL Dupes Code

SELECT column, COUNT (*) FROM table GROUP BY column HAVING

COUNT (*) > 1

 

Phil Nolette

NCSGroup, Inc.

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]]On Behalf Of suredata
Sent: Tuesday, August 07, 2001 5:36 PM
To: [EMAIL PROTECTED]
Subject: Capturing duplicates

I have a three-column table (say TestTable with columns Col1, Col2, Col3).  Duplicates are present.  I want to save all duplicates in a table or file.  Is there an easy way to achieve this?

 

TIA

 

Stan Loo

Reply via email to