Mysql删除重复数据

2014/03/06

查出重复数据放入tmp零时表中

create table tmp as select  min(id) as id  from restaurant_info  group  by  restaurant_name   having  count(restaurant_name) > 1;

根据零食表中id删除表中重复数据

delete from restaurant_info where id in(select id from tmp );

删除临时表

drop table tmp;

done.