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

示例代码如下:

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

 

posted @ 2015-11-04 17:45  jack_ou  阅读(2132)  评论(0编辑  收藏  举报