删除mysql数据库中的重复数据记录
程序员文章站
2024-01-20 13:06:10
...
mysql中select distinct * from text不能显示不重复的记录,而是直接全部显示
采用的是下面的方法可删除,假设重复的是test数据库中的title字段代码如下:
create table bak as (select * from test group by title having count(*)=1);
insert into bak (select * from test group by title having count(*)>1);
truncate table test;
insert into test select * from bak;
下一篇: 创建本地仓库,并上传到码云托管