mysql 表 删除重复信息
来源:互联网 发布:世事洞明皆学问 知乎 编辑:程序博客网 时间:2024/05/22 04:46
hello表
select * from hello where record in (select record from hello group by record having count(record)>1);
select * from hello where record in (select record from hello group by record having count(record)>1) and id not in (select min(id) from hello group by record having count(record)>1);
select * from hello where record in (select record from hello group by record having count(record)>1) and id not in (select min(id) from hello group by record having count(record)>1);
create table temp as select * from hello where record in (select record from hello group by record having count(record)>1);
delete from hello where id not in (select record from temp);
drop table temp;
delete from `hello` using `hello`,(select distinct min(`id`) as `id`, `time`, `record` from `hello` group by `time`, `record` having count(1)>1) as `t2` where `hello`.`time` = `t2`.`time` and `hello`.`record` = `t2`.`record` and `hello`.`id` <> `t2`.`id`
参考:http://www.cnblogs.com/consatan/archive/2010/12/17/1909087.html
- mysql 表 删除重复信息
- MySQL删除数据库某表中信息重复记录
- MYSQL 删除同一表中重复记录
- 删除MySQL表的重复记录
- mysql 删除表中重复记录
- mysql 删除数据库表中重复记录
- MySQL 删除表中重复记录
- 删除mysql 表中重复的记录
- 【数据库】MySQL删除表中重复数据
- 关于MySql删除表中重复数据
- mysql 删除重复数据
- mysql删除重复记录
- MYSQL 删除重复数据。。
- mysql删除重复记录
- MySQL删除重复数据
- mysql删除重复记录
- mysql删除重复数据
- mysql删除重复字段
- lamp配置问题
- android集成facebook
- 生成Excel文件
- jQuery实现表单的验证
- x$bh详解
- mysql 表 删除重复信息
- Python 3.2中 推导列表的简单小例子
- JDK、TOMCAT环境变量配置-精简配置
- Android抓取系统日志,然后作为文本附件发送邮件
- Jquery实现的小功能2、显示品牌的列表
- 优化屏障(Optimization barrier)第一讲
- GPS定位基本原理浅析
- 全球公共DNS解析服务器
- 优化屏障(Optimization barrier)第二讲