ms access - How to delete duplicate records in SQL that differ in a single field? -
i'm using access 2007.
i have table 20 fields. 1 of fields autonumber id, it's unique. have lot of records in table differ in autonumber id. can't delete ones odd or ids, because pairs of duplicates have both odds or both evens. ideas on how select 1 record each pair deletion?
i know done vba, i'm not familiar access vba yet, i'm looking purely sql-based solution.
delete * yourtable id not in ( select min(id) yourtable group field2 , filed3 , field4 , etc... <--- other fields, except id )
Comments
Post a Comment