access 中怎么删除重复项
展开全部
删除重复记录请参考下列SQL删除语句:
1)删除A表中Sid有重复的记录
delete from A where exists(
select 1 from (select Sid from A group by Sid having count(1)>1)t
where t.Sid=A.Sid);
2) 删除A表中Sid有重复的记录,如果有重复只保留一条(先决条件是A表必须有有自增ID标识列id)
delete from A where exists(
select 1 from (select min(id) as id,Sid
from A group by Sid having count(1)>1) t
where t.Sid=A.Sid and A.id>t.id);
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询