Mysql删除重复的数据 Mysql数据去重复
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);相关阅读:
jQuery中使用each处理json数据
javascript中innerText和innerHTML属性用法实例分析
ASP.NET网站聊天室的设计与实现(第3节)
ReactiveCocoa代码实践之-更多思考
Mac OS上通过boot2docker安装使用Docker的教程
C语言实现基于最大堆和最小堆的堆排序算法示例
javascript写的异步加载js文件函数(支持数组传参)
PHP缓存机制Output Control详解
JavaScript实现SHA-1加密算法的方法
php验证码实现代码(3种)
C语言实现图的遍历之深度优先搜索实例
Android笔记之:CM9源码下载与编译的应用
html5 乒乓球(碰撞检测)实例二
linux怎么让让垃圾文件自己消失?