eliminating all but 1 of duplicates
Thanks in advance for any assistance.
I have a table that is added to daily and due to some bad records coming from vendor, I end up with duplicate records that are not perfectly alike.
SAMPLE DATA:
customer_number field2 field3 field4
12345 abc 123 abc
12345 abc NULL NULL
6789 def 456 hij
6789 def NULL NULL
11111 wxyz NULL NULL
I need to eliminate records with duplicate customer_number and null in any field. But I want to leave non-duplicate records with null in any field. The database holds many years of monthly data so there will be duplicate customer numbers, but I only want to keep duplicates with no nulls. I can't delete records with nulls (if not duplicate) and I can't jus delete dups w/o nulls.
thanks again,
|