--查询表中重复数据
select * from 表名 t where t.id in (
SELECT id FROM 表名 GROUP BY id HAVING COUNT(主键编号)>1
);
--去除表中重复数据
delete from 表名 a where rowid not in (
select max(b.rowid) from 表名 b where a.主键编号 = b.主键编号
);
时间: 2024-10-12 03:12:16
--查询表中重复数据
select * from 表名 t where t.id in (
SELECT id FROM 表名 GROUP BY id HAVING COUNT(主键编号)>1
);
--去除表中重复数据
delete from 表名 a where rowid not in (
select max(b.rowid) from 表名 b where a.主键编号 = b.主键编号
);