mysql 用sql 语句去掉某个字段重复值数据的方法

时间:2015-11-04 19:12:45   收藏:0   阅读:279

示例代码如下:

create table tmp as select min(主键) as col1 from 去重表名 GROUP BY 去重字段;
delete from 去重表名 where 主键 not in (select col1 from tmp); 
drop table tmp;

 

原文:http://www.cnblogs.com/langtianya/p/4936750.html

评论(0
© 2014 bubuko.com 版权所有 - 联系我们:wmxa8@hotmail.com
打开技术之扣,分享程序人生!