URGENT--> SQL query needed... Remove Duplicate records
Posted on 2004-04-08
SQL 2000 DB
I need a query that finds all duplicate records within a table of ~6million records and deletes all but one of the duplicates. I just need to search on 1 field (BCNUM) (which is indexed but not unique, obviously)... basically I want no more than 1 record with the BCNUM becoming unique.
In addition, how would I need to run the query above if I wanted 3 fields to match as opposed to just the one (i.e. find duplicates where BCNUM, CUSTNUM,INVNUM all match another record w/ the same 3 values)