假定表table1(col1,col2,col3),在表中加入一个autonumber类型的字段id,该字段会自动生成每个纪录的id,然后用下面的语句可以删除所有的重复纪录(只保留一条):
delete *
FROM Table1 as t
where id not in (select max(id) from table1
                  where col1=t.col1
                    and col2=t.col2
                    and col3=t.col3);
注意:本方法假定col1/col2/col3都不是空值或者用下面的方法,col1/col2/col3可以为空值,但是效率应该比上面的差一点。
delete *
FROM Table1 as t
where id not in (select max(id) from table1 group by col1,col2,col3);最后,把id列从表中删除掉。