1.如表中没有主键,先添加自动增长主键

alter table 表名 add 列名 int identity (1,1) primary key

2.删除重复数据

delete from 表名 where id not in
(select min(id) from 表名 group by id)

------id1为新增自增的列,id为原来没有自增的id列

delete from DeceasedInformation where id1 not in
(select MIN(id) from DeceasedInformation group by id)

SQL语句删除重复数据

 

相关文章:

  • 2021-05-24
  • 2021-10-03
  • 2021-04-04
  • 2021-07-01
  • 2021-07-03
  • 2021-12-21
猜你喜欢
  • 2022-12-23
  • 2021-11-01
  • 2021-04-06
  • 2021-05-24
  • 2021-07-30
  • 2021-10-19
  • 2022-12-23
相关资源
相似解决方案