手机
当前位置:查字典教程网 >编程开发 >mysql数据库 >Mysql删除重复的数据 Mysql数据去重复
Mysql删除重复的数据 Mysql数据去重复
摘要:MySQL数据库中查询重复数据select*fromemployeegroupbyemp_namehavingcount(*)>1;Mysq...

MySQL数据库中查询重复数据

select * from employee group by emp_name having count (*)>1;

Mysql 查询可以删除的重复数据

select t1.* from employee t1 where (t1.emp_name) in (select t4.emp_name from (select t2.emp_name from employee t2 group by t2.emp_name having count(*)>1) t4) and t1.emp_id not in (select t5.emp_id from (select min(t3.emp_id) as emp_id from employee t3 group by t3.emp_name having count(*)>1) t5);

Mysql 删除重复的数据

delete t1 from employee t1 where (t1.emp_name) in (select t4.emp_name from (select t2.emp_name from employee t2 group by t2.emp_name having count(*)>1) t4) and t1.emp_id not in (select t5.emp_id from (select min(t3.emp_id) as emp_id from employee t3 group by t3.emp_name having count(*)>1) t5);

【Mysql删除重复的数据 Mysql数据去重复】相关文章:

解决hibernate+mysql写入数据库乱码

Mysql 数字类型转换函数

删除重复记录的sql语句

快速修复损坏的MySQL数据库

MYSQL删除匿名用户的方法(提高安全性)

MySQL 重装MySQL后, mysql服务无法启动

mysql 10w级别的mysql数据插入

Mysql 数据库访问类

简单的MySQL数据库主从同步配置

mysql 查询重复的数据的SQL优化方案

精品推荐
分类导航