Mysql大数据表删除重复数据
来源:互联网 发布:mac应用程序卸载 编辑:程序博客网 时间:2024/09/21 09:03
对没有索引的字段进行查询重复时如果使用select name from table where name in(select name from table group by name having count(name)>1)这类查询,效率非常低,是不可取的,下面给出替代步骤:
1.根据重复记录创建临时表
create table temptable as (
select title from video
GROUP BY title HAVING count(title) >1
);
2.查询重复数据
select a.* from temptable t,video a where a.title=t.title;
下面给出实际中我使用的删除重复数据的脚本,供参考:
create table temptable as ( select MAX(id) as id from video GROUP BY title HAVING count(title) >1);delete from video where id in (select id from temptable) order by id ;drop table temptable;
0 0
- Mysql大数据表删除重复数据
- MYSQL中快速高效删除大数据表中的重复数据
- 删除数据表中的重复数据
- 删除数据表中的重复数据
- postgre删除数据表重复数据
- MySql-如何查询删除数据表重复记录
- 查找删除mysql数据表中重复记录
- MySql-如何查询删除数据表重复记录
- oracle删除数据表中重复数据
- 删除数据表DATATABLE里重复的数据
- mysql 删除重复数据
- MYSQL 删除重复数据。。
- MySQL删除重复数据
- mysql删除重复数据
- mysql 删除重复数据
- mysql删除重复数据
- 删除mysql 重复数据
- mysql 删除重复数据
- 分享一个失真度较小的图片缩小方法
- 关于Spring中常被问到的一些问题
- File的getPath getAbsolutePath和getCanonicalPath的不同
- Linux下分析日志常用命令
- CMake 简明教程(2)---编译库文件
- Mysql大数据表删除重复数据
- 总结一下用caffe跑图片数据的研究流程
- ReentrantReadWriteLock优势及使用
- Mysql中Insert into xxx on duplicate key update和REPLACE INTO使用
- PHP抓取网页内容,获取链接绝对路径和图片绝对路径
- html容器中图片水平居中
- 应用程序扩展性实现的十宗罪
- 编程珠玑:取样问题
- Js动态传递不定数目的参数